Skip to content

~. short-circuits Multicast DNS resolution in systemd-resolved #10125

Closed

Description

@gdiscry

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 with resolvectl 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

  1. Enable MulticastDNS globally and on the link.
  2. Add ~. to the search domains (resolvectl domain <link> ~.).
  3. Try to resolve <host>.local for a host other than the local host and fail.
  4. Remove ~. from the search domains (resolvectl revert <link>; resolvectl mdns <link> yes).
  5. Try to resolve <host>.local for a host other than the local host and succeed.

Activity

  1. poettering commented on Sep 24, 2018

    @poettering
    Member

    I am sorry, but why do you configure ~. as routing domain in the first place?

  2. added
    needs-reporter-feedback ❓
    on Sep 24, 2018
  3. gdiscry commented on Sep 24, 2018

    @gdiscry
    Author

    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 that Domains=~. is special and is used for "all DNS traffic which does not match another configured domain routing entry". In man 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 enabling MulticastDNS means that we have a match for ~.local and ~. 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 ~..

  4. sza-1 commented on Oct 1, 2018

    @sza-1

    @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).

  5. added and removed
    needs-reporter-feedback ❓
    on Dec 4, 2018
  6. poettering commented on Dec 4, 2018

    @poettering
    Member

    Fix waiting in #11050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions