Help people to make the switch
Maybe it would be a good idea to mention what you need to do when switching over from other configurations, like switching from
systemd-resolved. Like for example disabling the
/etc/resolv.conf, etc. If people agree, I could add something like this.
Systemd-resolved#Manually implies that setting
Domains=~. in the
section will make systemd-resolved prefer custom DNS servers over per-link ones.
However, at least on my laptop,
after following these instructions and making a query with
both custom and per-link
servers are queried, with the results from the per-link server being preferred (observed via
Is this a problem with the wiki page or is it possibly a bug in
resolved (or is this problem
unique to me)?
DNS server order?
I don't see systemd-resolved to preserve order on multiple DNS servers. It is constantly switching in between but i don't want that. The 2nd server is only for backup of the 1st. Normal resolv.conf is waiting 5 seconds till it takes the next server in order.
- And how do you expect the switching to your 2nd server to work? -- Lahwaacz (talk) 07:58, 16 March 2021 (UTC)
Globally enabled, but per network disabled by default?
The section Systemd-resolved#mDNS contains something like this:
systemd-resolved's mDNS support can be enabled by …
Enabling per-connection mDNS support depends on the network manager: …
This didn’t show the fact that mDNS needs to be individually enabled per-connection, even if it is globally enabled. From manual:
Note thatalso maintains per-link Multicast DNS settings. Multicast DNS will be enabled on a link only if the per-link and the global setting is on.
Stopping NetworkManager overwrite /etc/resolv.conf
/etc/resolv.conf with a symbolic link by:
# ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Whenever NetworkManager restarted, it overwrites the
/etc/resolv.conf symbolic link. To avoid that need to add
/etc/dhcpcd.conf if dhcpcd used as the dhcp client. If other dhcp clients used, may need different procedures.
I spent lots of time to achieve this by adjust the configuration file of NetworkManager, but nothing worked. Shall we mentioned this here to help others?
- Since you use NetworkManager, this should be documented in NetworkManager#/etc/resolv.conf. — Lahwaacz (talk) 20:49, 1 June 2023 (UTC)
When systemd-resolved is enabled, and /etc/resolv.conf doesn't exist, tmpfiles.d creates the stub-resolv.conf symlink. This might be better, because it works inside chroot.