Talk:Systemd-resolved

From ArchWiki
Latest comment: 7 July 2023 by Therealmate in topic Replace symlink with rm

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 netctl + dhcpd to systemd-networkd + systemd-resolved. Like for example disabling the dhcpd.service, symlinking /etc/resolv.conf, etc. If people agree, I could add something like this.

—This unsigned comment is by Hendrikto (talk) 21:52, 2 April 2019‎. Please sign your posts with ~~~~!

Custom vs per-link DNS: possibly inaccurate information

Systemd-resolved#Manually implies that setting Domains=~. in the [Resolve] 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 resolvectl query both custom and per-link servers are queried, with the results from the per-link server being preferred (observed via tcpdump). Is this a problem with the wiki page or is it possibly a bug in resolved (or is this problem unique to me)?

Ltskv (talk) 14:42, 11 April 2020 (UTC)Reply

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.

—This unsigned comment is by DocMAX (talk) 23:43, 15 March 2021‎ (UTC). Please sign your posts with ~~~~!Reply

And how do you expect the switching to your 2nd server to work? -- Lahwaacz (talk) 07:58, 16 March 2021 (UTC)Reply
Did DocMax used DNS, and FallbackDNS in /etc/systemd/resolved.conf? Will they give the desired behavior? Regid (talk) 13:04, 8 October 2022 (UTC)Reply

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 that systemd-networkd.service(8) also 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.

And the network-level MulticastDNS is disabled by default: manual. This unintuitive behavior may worth being mentioned in this section? --Franklin Yu (talk) 15:37, 7 December 2022 (UTC)Reply

Stopping NetworkManager overwrite /etc/resolv.conf

After replace /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

nohook resolv.conf

to file /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?

Leeli (talk) 17:23, 1 June 2023 (UTC)Reply

Since you use NetworkManager, this should be documented in NetworkManager#/etc/resolv.conf. — Lahwaacz (talk) 20:49, 1 June 2023 (UTC)Reply

Replace symlink with rm

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.
rm /etc/resolv.conf

—This unsigned comment is by Therealmate (talk) 13:26, 7 July 2023 (UTC). Please sign your posts with ~~~~!Reply