Repository navigation
Description
I want to use systemd-resolved as a Multicast DNS responder and resolver (replacing Avahi and nss-mdns) on a machine using NetworkManager. However, NetworkManager always adds the ~. routing-only domain to the connection with the default route or if there is none, to all non-VPN connections. That wildcard completely short-circuits Multicast DNS resolution.
This might be an issue with NetworkManager that should not add the routing-only domain. Or it might be exepected behaviour as there is precedence that an explicit search domain using local should short-circuit Multicast DNS (#8852).
The big difference here is that it's not an explicit search domain and I think that there is an argument for Multicast DNS having an higher priority than ~. when it comes to the local domain and its special meaning.
Furthermore, this issue is not limited to NetworkManager. It also occurs with systemd-networkd when Domains=~. is used in a .network file and the systemd.network man page is not clear that this is expected bahviour.
systemd version the issue has been seen with
systemd 239
Used distribution
Arch Linux
Expected behaviour you didn't see
Working Multicast DNS resolution when MulticastDNS is enabled globally and on the link, without having to use
resolvectl query -p mdns.
Unexpected behaviour you saw
Multicast DNS resolution only works for the local host (
resolvectl query $(hostname -s).local) but the information is acquired via the DNS protocol.
For the other hosts on the LAN, resolution fails with<host>.local: resolve call failed: '<host>.local' not found. It only works for those hosts if the Multicast DNS protocol is explicitly used withresolvectl query -p mdns.
The~.construct has to be removed from the DNS Domain of the link for it to work normally.
Steps to reproduce the problem
- Enable MulticastDNS globally and on the link.
- Add
~.to the search domains (resolvectl domain <link> ~.). - Try to resolve
<host>.localfor a host other than the local host and fail. - Remove
~.from the search domains (resolvectl revert <link>; resolvectl mdns <link> yes). - Try to resolve
<host>.localfor a host other than the local host and succeed.
Activity
poettering commentedon Sep 24, 2018
I am sorry, but why do you configure
~.as routing domain in the first place?gdiscry commentedon Sep 24, 2018
In the steps, I only configured
~.as routing domain to show how to reproduce the issue without NetworkManager. But in practice, it's NetworkManager that always configures~.on my link.I opened an issue for systemd-resolved first because it can be triggered without NetworkManager and the man pages are not clear on this point. In
man systemd.network, the documentation explains thatDomains=~.is special and is used for "all DNS traffic which does not match another configured domain routing entry". Inman systemd-resolved, it says that "by default lookups for domains with the ".local" suffix are not routed to DNS servers, unless the domain is specified explicitly as routing or search domain for the DNS server and interface." I can see an interpretation of that documentation where enablingMulticastDNSmeans that we have a match for~.localand~.is not explicit enough for~.local.Nevertheless, if this is the expected behaviour, the documentation could probably be improved to make it more explicit and I'll open an issue with NetworkManager regarding their use of
~..sza-1 commentedon Oct 1, 2018
@gdiscry I'm trying to setup mDNS with NetworkManager 1.14.1 and systemd 239 last month and have encountered the same issue. It looks like NM and resolved have different understandings about "~." usage. Just FYI, I have posted the report: NetworkManager erroneously pushes (in systemd-resolved mode) root routing domain when there are no any domains got from DNS server).
poettering commentedon Dec 4, 2018
Fix waiting in #11050