[Dnsmasq-discuss] How to create /etc/resolv.conf after removing systemd-resolved?

Petr Menšík pemensik at redhat.com
Thu Jun 6 13:15:52 UTC 2024


Depends on how you use dnsmasq. If you use NetworkManager managed 
instance, it can create /etc/resolv.conf for you. Define dns=dnsmasq in 
NetworkManager.conf and restart the service. That's it!

Or just rm -f /etc/resolv.conf && sudoedit /etc/resolv.conf, manually.

On 04. 06. 24 11:10, Chris Green wrote:
> I run dnsmasq instead of systemd-resolved on all my systems.
>
> I have just built a new xubuntu 24.04 system and, having disabled
> systemd-resolved and installed dnsmasq it appears to be working OK but
> the /etc/resolv.conf symbolic link is broken, so there's no
> /etc/resolv.conf which upsets some programs.
>
> Should I just manually edit /etc/resolv.conf or is there some better
> way of handling this?  All the systems in question just use dnsmasq
> for local DNS cacheing and use the router at 192.168.1.1 for upstream
> DNS queries.  Thus, on other systems on the LAN, I just have an
> /etc/resolv.conf file as follows:-
>
>      search zbmc.eu
>      nameserver 127.0.0.1
>
> Should I just create an /etc/resolv.conf like this for the new system?

No, there is no way on dnsmasq to manage /etc/resolv.conf. Just create 
it manually as normal file. Depends on if you use resolvconf or similar 
tool. At least on Fedora systemd-resolved tends to take 
/etc/resolv.conf, if it already does not exist on boot. So you need to 
create it as normal file to prevent it.

I suggest adding option ends0 trust-ad into it. Dnsmasq's TCP retry is 
somehow poor, using edns0 wherever it works will improve its 
performance. It should work on every sane network. Consider lowering 
timeout and increasing attempts. options timeout:3 attempts:3 or 
timeout:2 attempts:4 might work better. Dnsmasq retries are driven by 
external clients, caching should reduce issues with it when network works.

-- 
Petr Menšík
Software Engineer, RHEL
Red Hat,http://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20240606/87e37f6b/attachment.htm>


More information about the Dnsmasq-discuss mailing list