[Dnsmasq-discuss] How to create /etc/resolv.conf after removing systemd-resolved?
Chris Green
cl at isbd.net
Thu Jun 6 20:50:43 UTC 2024
On Thu, Jun 06, 2024 at 03:15:52PM +0200, Petr Menšík wrote:
> 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.
Thanks Peter, that's just the sort of stuff I wanted to know. Given
that I'm not using resolvconf or similar it would seem that a simple,
manually created, /etc/resolv.conf is the right way to handle this.
--
Chris Green
More information about the Dnsmasq-discuss
mailing list