Skip to content

systemd-resolved SERVFAIL "No appropriate name servers" for search domains #6976

Open

Description

@johnl

Submission type

  • Bug report

systemd version 234 (234-2ubuntu10 on ubuntu 17.10)

ubuntu 17.10

domains within search domains should resolve successfully but instead they fail to resolve with error "resolve call failed: No appropriate name servers or networks for name found"

Setup resolv.conf as:

nameserver 127.0.0.53
search facebook.com

then attempt to lookup www.facebook.com (or facebook.com):

$ systemd-resolve facebook.com
facebook.com: resolve call failed: No appropriate name servers or networks for name found

$ systemd-resolve www.facebook.com
www.facebook.com: resolve call failed: No appropriate name servers or networks for name found

$ host www.facebook.com
Host www.facebook.com not found: 2(SERVFAIL)

debug log:

Oct 03 12:49:01 dogen systemd-resolved[32040]: Got message type=method_call sender=:1.562 destination=org.freedesktop.resolve1 object=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Looking up RR for www.facebook.com IN A.
Oct 03 12:49:01 dogen systemd-resolved[32040]: Looking up RR for www.facebook.com IN AAAA.
Oct 03 12:49:01 dogen systemd-resolved[32040]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=48 reply_cookie=0 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.509 object=n/a interface=n/a member=n/a cookie=39 reply_cookie=48 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=49 reply_cookie=0 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.509 object=n/a interface=n/a member=n/a cookie=40 reply_cookie=49 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Cache miss for www.facebook.com IN A
Oct 03 12:49:01 dogen systemd-resolved[32040]: Transaction 60262 for <www.facebook.com IN A> scope dns on */*.
Oct 03 12:49:01 dogen systemd-resolved[32040]: Transaction 60262 for <www.facebook.com IN A> on scope dns on */* now complete with <no-servers> from none (unsigned).
Oct 03 12:49:01 dogen systemd-resolved[32040]: Freeing transaction 60262.
Oct 03 12:49:01 dogen systemd-resolved[32040]: Sent message type=error sender=n/a destination=:1.562 object=n/a interface=n/a member=n/a cookie=50 reply_cookie=2 error=No appropriate name servers or networks for name found
Oct 03 12:49:01 dogen systemd-resolved[32040]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=51 reply_cookie=0 error=n/a
Oct 03 12:49:01 dogen systemd-resolved[32040]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.509 object=n/a interface=n/a member=n/a cookie=41 reply_cookie=51 error=n/a

Activity

  1. poettering commented on Oct 4, 2017

    @poettering
    Member

    so, do you have any name servers configured as well as a network connection that works? What does "systemd-resolve --status" say?

    if you don't have DNS servers configured or no network connection set up, this is the error you get, and it has nothing to do with domain search lists..

  2. added
    needs-reporter-feedback ❓
    on Oct 4, 2017
  3. johnl commented on Oct 4, 2017

    @johnl
    Author

    I do have name servers configured (network manager gets them from dhcp). all other domains not listed as search domains work fine, even new lookups that haven't been cached. And I've tried flushing the systemd-resolved cache and fully restarting it too.

    $ systemd-resolve --status
    
    Global
              DNS Domain: facebook.com
              DNSSEC NTA: 10.in-addr.arpa
                          16.172.in-addr.arpa
                          168.192.in-addr.arpa
                          17.172.in-addr.arpa
                          18.172.in-addr.arpa
                          19.172.in-addr.arpa
                          20.172.in-addr.arpa
                          21.172.in-addr.arpa
                          22.172.in-addr.arpa
                          23.172.in-addr.arpa
                          24.172.in-addr.arpa
                          25.172.in-addr.arpa
                          26.172.in-addr.arpa
                          27.172.in-addr.arpa
                          28.172.in-addr.arpa
                          29.172.in-addr.arpa
                          30.172.in-addr.arpa
                          31.172.in-addr.arpa
                          corp
                          d.f.ip6.arpa
                          home
                          internal
                          intranet
                          lan
                          local
                          private
                          test
    
    Link 16 (bnep0)
          Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
             DNS Servers: 192.168.44.1
    
    Link 3 (wlp4s0)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
             DNS Servers: 2001:470:20::2
    
    Link 2 (enp0s31f6)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
    
  4. poettering commented on Oct 5, 2017

    @poettering
    Member

    so my educated guess is that because the /etc/resolv.conf you supplied is not the one resolved itself wrote out resolved reads it in, and consideres it authoritative and as configuration source. However, it drops the 127.0.0.53 entry from it, since it knows that it is itself which is listening on that. Hence you basically told resolved about a search list, but at the same time you configured it to use an empty DNS server list.

    i figure this is ultimately all because of the shortcoming that is explained in #7009, right?

    I figure we should fix #7009 so that writing such manual resolv.conf snippets is not necessary, and we should make sure that handle things better if they are encountered.

  5. removed
    needs-reporter-feedback ❓
    on Oct 5, 2017
  6. added this to the v236 milestone on Oct 5, 2017
  7. johnl commented on Oct 5, 2017

    @johnl
    Author

    But I can lookup other records on all other domains fine when the search list is configured.

    here is a log of me looking up facebook.com, which is in the search list, and then looking up github.com, which isn't in the search list. They're the first two lookups after a restart of systemd-resolved, so no cache. facebook.com lookup fails but github.com succeeds (I'm on a different network right now but same behaviour):

    Oct 05 18:51:34 dogen systemd-resolved[14726]: Got message type=method_call sender=:1.1181 destination=org.freedesktop.resolve1 object=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Looking up RR for facebook.com IN A.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Looking up RR for facebook.com IN AAAA.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=4 reply_cookie=0 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=6 reply_cookie=4 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=5 reply_cookie=0 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=7 reply_cookie=5 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Switching to DNS server 192.168.88.254 for interface wlp4s0.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Cache miss for facebook.com IN AAAA
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Transaction 59248 for <facebook.com IN AAAA> scope dns on */*.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Transaction 59248 for <facebook.com IN AAAA> on scope dns on */* now complete with <no-servers> from none (unsigned).
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Cache miss for facebook.com IN A
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Transaction 9837 for <facebook.com IN A> scope dns on */*.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Transaction 9837 for <facebook.com IN A> on scope dns on */* now complete with <no-servers> from none (unsigned).
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Freeing transaction 59248.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Freeing transaction 9837.
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Sent message type=error sender=n/a destination=:1.1181 object=n/a interface=n/a member=n/a cookie=6 reply_cookie=2 error=No appropriate name servers or networks for name found
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=7 reply_cookie=0 error=n/a
    Oct 05 18:51:34 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=8 reply_cookie=7 error=n/a
    
    
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Got message type=method_call sender=:1.1182 destination=org.freedesktop.resolve1 object=/org/freedesktop/resolve1 interface=org.freedesktop.resolve1.Manager member=ResolveHostname cookie=2 reply_cookie=0 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Looking up RR for github.com IN A.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Looking up RR for github.com IN AAAA.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=AddMatch cookie=8 reply_cookie=0 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=9 reply_cookie=8 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=GetNameOwner cookie=9 reply_cookie=0 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=10 reply_cookie=9 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Cache miss for github.com IN AAAA
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 41642 for <github.com IN AAAA> scope dns on */*.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 41642 for <github.com IN AAAA> on scope dns on */* now complete with <no-servers> from none (unsigned).
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Cache miss for github.com IN A
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 55567 for <github.com IN A> scope dns on */*.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 55567 for <github.com IN A> on scope dns on */* now complete with <no-servers> from none (unsigned).
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Cache miss for github.com IN AAAA
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 55207 for <github.com IN AAAA> scope dns on wlp4s0/*.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Using feature level UDP+EDNS0 for transaction 55207.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Using DNS server 192.168.88.254 for transaction 55207.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sending query packet with id 55207.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Cache miss for github.com IN A
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 4689 for <github.com IN A> scope dns on wlp4s0/*.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Using feature level UDP+EDNS0 for transaction 4689.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Using DNS server 192.168.88.254 for transaction 4689.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sending query packet with id 4689.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Processing incoming packet on transaction 55207. (rcode=SUCCESS)
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Verified we get a response at feature level UDP+EDNS0 from DNS server 192.168.88.254.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Not caching negative entry without a SOA record: github.com IN AAAA
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 55207 for <github.com IN AAAA> on scope dns on wlp4s0/* now complete with <success> from network (unsigned).
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Processing incoming packet on transaction 4689. (rcode=SUCCESS)
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Added positive unauthenticated cache entry for github.com IN A 21s on */INET/192.168.88.254
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Added positive unauthenticated cache entry for github.com IN A 21s on */INET/192.168.88.254
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Transaction 4689 for <github.com IN A> on scope dns on wlp4s0/* now complete with <success> from network (unsigned).
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Freeing transaction 41642.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Freeing transaction 55567.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Freeing transaction 55207.
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sent message type=method_return sender=n/a destination=:1.1182 object=n/a interface=n/a member=n/a cookie=10 reply_cookie=2 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Sent message type=method_call sender=n/a destination=org.freedesktop.DBus object=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RemoveMatch cookie=11 reply_cookie=0 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Got message type=method_return sender=org.freedesktop.DBus destination=:1.1180 object=n/a interface=n/a member=n/a cookie=11 reply_cookie=11 error=n/a
    Oct 05 18:51:39 dogen systemd-resolved[14726]: Freeing transaction 4689.
    

    as to why I'm using /etc/resolv.conf at all - it just seems to be the Ubuntu 17.10 arrangement. I configured my search domains in the gui of network-manager and when it connects to the network it adds my search domains in there for me (along with the line nameserver 127.0.0.53 yes) /etc/resolv.conf is symlinked to /run/resolvconf/resolv.conf.

  8. Zenexer commented on Nov 9, 2017

    @Zenexer

    Workaround: leave resolv.conf as the default (generated by systemd); on my system it's linked to /run/systemd/resolve/resolv.conf. Then, add your search domains to /etc/systemd/resolved.conf in the form Domains=example.com another.example.com.

  9. Zenexer commented on Nov 9, 2017

    @Zenexer

    Note that even with the workaround, dig won't work as expected, as systemd only appends the search suffixes to unqualified domains. If asked to query example, dig will instead query example., which won't have a suffix appended. This behavior differs from the old system, I believe, and will break some applications.

  10. poettering commented on Dec 8, 2017

    @poettering
    Member

    See my comment at #7544 (comment)

  11. removed this from the v236 milestone on Dec 8, 2017
  12. danielfett commented on Dec 9, 2017

    @danielfett

    (I filed #7544 originally, continuing the discussion here!)

    @poettering you said "This doesn't make available what @webhamster is trying to do, ..."

    The thing is, I did not configure anything about this manually (all DHCP, no special settings in network-manager as far as I can tell). The real problem here seems to be that that somebody (network-manager?) is removing the DNS server entries, but not the search list entries. For example, currently the content of resolv.conf is:

    search fritz.box t-mobile.de client.m3-hotspots.de rus.uni-stuttgart.de uni-stuttgart.de sec.uni-stuttgart.de
    

    Note that except for the first entry, none of these entries should still be in the list, since the only network I'm currently connected to is the "fritz.box" network, not the T-Mobile network and not the uni-stuttgart network (I was connected to them yesterday, but did not reboot in the mean time).

    The current systemd-resolved status is:

    Global
              DNS Domain: fritz.box
                          t-mobile.de
                          client.m3-hotspots.de
                          rus.uni-stuttgart.de
                          uni-stuttgart.de
                          sec.uni-stuttgart.de
              DNSSEC NTA: 10.in-addr.arpa
                          16.172.in-addr.arpa
                          168.192.in-addr.arpa
                          17.172.in-addr.arpa
                          18.172.in-addr.arpa
                          19.172.in-addr.arpa
                          20.172.in-addr.arpa
                          21.172.in-addr.arpa
                          22.172.in-addr.arpa
                          23.172.in-addr.arpa
                          24.172.in-addr.arpa
                          25.172.in-addr.arpa
                          26.172.in-addr.arpa
                          27.172.in-addr.arpa
                          28.172.in-addr.arpa
                          29.172.in-addr.arpa
                          30.172.in-addr.arpa
                          31.172.in-addr.arpa
                          corp
                          d.f.ip6.arpa
                          home
                          internal
                          intranet
                          lan
                          local
                          private
                          test
    
    Link 6 (vboxnet0)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
    
    Link 3 (wlan0)
          Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
             DNS Servers: 192.168.178.1
                          fd00::3681:c4ff:fe3b:86c1
              DNS Domain: fritz.box
    
    Link 2 (eth0)
          Current Scopes: none
           LLMNR setting: yes
    MulticastDNS setting: no
          DNSSEC setting: no
        DNSSEC supported: no
             DNS Servers: 2001:7c0:2015:182::3
    
  13. thotypous commented on Dec 11, 2017

    @thotypous

    I was struggling with the same behaviour @webhamster reported. It took me some time to realize search was causing it. Before realizing it, I always needed to reboot after coming home from my university, otherwise I was not able to resolve names under the university's domain. Restarting systemd-resolve does not fix the issue. The workaround is to manually remove the search line from the auto-generated /etc/resolv.conf file (which still contains the university domain even though I am now at home -- it is automatically cleared only after a reboot).

  14. poettering commented on Dec 13, 2017

    @poettering
    Member

    The real problem here seems to be that that somebody (network-manager?) is removing the DNS server entries, but not the search list entries. For example, currently the content of resolv.conf is:

    This smells like a bug in Debian's/Ubuntu's resolvconf, or the hookup with it, and not with resolved really. Note that if your resolv.conf is managed by resolved, then it will contain a longer commented header explaining that. Since you don't have that it's something else that writes your resolv.conf, and the bug must be in that.

  15. 6 remaining items

  16. codeaholics commented on Jan 23, 2018

    @codeaholics

    Certainly uninstalling resolvconf improved my situation, but I think there's still a bug in systemd-resolvd here. Why, when I have my home domain in the search list in resolv.conf, can systemd-resolvd not resolve either an unqualified name in that domain, or a FQDN using that domain?

  17. JanKanis commented on Jan 29, 2018

    @JanKanis

    I also ran into (what appears to be) this problem. Removing the resolvconf package fixed it.

  18. Gargravarr2112 commented on Jan 30, 2018

    @Gargravarr2112

    Hmm, I'm trying the alpha version of Ubuntu 18.04 from a fresh install and running into this same issue, but resolvconf is not installed. Editing /etc/resolv.conf manually restored DNS, but a reboot removes the customisation and the problem recurs.

    Output of systemd-resolve --status:

    Global

          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test
    

    Link 3 (docker0)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 2 (wlp58s0)
    Current Scopes: LLMNR/IPv4 LLMNR/IPv6
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    systemd --version: 235

    Kernel version: 4.13.0-25-generic x64

  19. AJRepo commented on Feb 4, 2018

    @AJRepo

    The core issue seems to be with the fact that resolvconf does not clear out old domains in the "search" line in /etc/resolv.conf when given a new one by a DHCP server when moving between DHCP networks.

    I can reliably replicate this problem with the following process:

    1. Connect to network Example1.com with DHCP server which sets the domain search = example1.com.
    2. Observe /etc/resolv.conf which has the line search example1.com
    3. Hibernate laptop
    4. Un-hibernate laptop and connect to network Example2.com with DHCP server which sets domain search = example2.com
    5. Observe /etc/resolv.conf which now has the line search example1.com example2.com
    6. Try to get to something.example1.com and get the SERVFAIL error message above.

    If you repeat steps 3,4,5 with new DHCP networks then you get in /etc/resolv.conf
    search example1.com example2.com example3.com example4.com .....

    As a workaround you can delete the domains in /etc/resolv.conf that shouldn't be there.

    Otherwise, when connected to exampleN.com's network you get the SERVFAIL for example1.com, example2,com ... exampleN-1.com. Essentially all the other domains that are in the search line in /etc/resolv.conf

  20. Zenexer commented on Feb 9, 2018

    @Zenexer

    @AJRepo I'm encountering SERVFAIL issues without bad search lines. The only solution I have found so far is to manually set something other than 127.0.0.1 as the nameserver in resolv.conf. This happens on all distros, on all networks, on a wide range of devices. Enterprise networks, home networks, coffee shop networks. Ubuntu, Arch, and anything else I happened to use recently (probably quite a few). It happens out-of-the-box, with no configuration on my part other than connecting to either a wireless or wired Ethernet networks.

  21. codeaholics commented on Feb 9, 2018

    @codeaholics

    @AJRepo I disagree with your analysis. Which is to say your analysis is correct, but incomplete! Yes, there's a problem with resolvconf which goes away if that package is removed.

    However, this is the scenario I observe:

    • I connect to my home VPN and then disconnect
    • resolvconf mistakenly leaves myhome.net in the search path
    • I cannot correctly resolve any names in that domain using either the plain host name, OR the FQDN. That is, nslookup mynas and nslookup mynas.myhome.net both fail.

    Yes, myhome.net shouldn't be left in the search path. Yes, that's a bug in resolvconf (most likely). But given that it's there, why can't systemd-resolvd correctly resolve names in that domain? The DNS entries are in the public DNS, BTW, not hidden in a private DNS server only accessible on my VPN.

  22. runderwo commented on Feb 9, 2018

    @runderwo

    @codeaholics Yes, this is exactly my experience and I had exactly the same question when I found that removing the left-behind search paths solved the problem. Why shouldn't these FQDN be resolved correctly just because part of the name is in the search path (whether by design or by accident)?

  23. johnl commented on Feb 9, 2018

    @johnl
    Author

    I don't know why this is being linked to resolvconf so much, perhaps I don't understand how it works properly.

    If I just make /etc/resolv.conf a normal file, edit it with vim and add a search domain for facebook.com, looking up www.facebook.com is then broken as I originally described. If I remove the search domain from resolv.conf it starts working again.

    resolvconf doesn't seem in play here.

  24. codeaholics commented on Feb 9, 2018

    @codeaholics

    @johnl absolutely! There is a resolvconf issue, and it exacerbates this issue, but they are otherwise unrelated.

  25. AJRepo commented on Feb 9, 2018

    @AJRepo

    @Zenexer Did you mean 127.0.0.53, not 127.0.0.1? I believe that 127.0.0.53 is the systemd-resolved stub resolver.

    @codeaholics & @runderwo What resolv.conf determines is a FQDN can depend on the network to which you connect. There are networks where machine names might look like "foo.k12.bar.us" where if you type baz.bar.us it isn't yet a FQDN. Documentation for resolv.conf states that this is affected by the ndots parameter but on my system that's not set so should fall back to the default of 1. In other tests I think this is not an ndots issue (see below).

    @johnl The reason this is being linked to resolvconf is that if resolvconf is enabled then the file /etc/resolv.conf is being generated by resolvconf with the odd search line. In fact if someone has resolvconf enabled, it warns you this the file /etc/resolv.conf will be overwritten.

    Further investigation:
    Doing a tcpdump of TCP/UDP traffic I see what's happening is that the 2nd and additional domains specified in the search line do not get sent out via the interfaces connected to the internet. You can force this with the -i flag.

    systemd-resolve -i eth0 www.example2.com

    works but

    systemd-resolve www.example2.com

    does not. So it seems that the additional domains on the search line interfere with which interface is used by systemd-resolve for DNS lookups.

  26. Zenexer commented on Feb 11, 2018

    @Zenexer

    @AJRepo You're right, it's 127.0.0.53. I just instinctively wrote 127.0.0.1.

    Oddly, I just checked, and on two of my Ubuntu 17.10 installations, it's now working, even with a bogus search domain that doesn't resolve on one of them. I could swear I implemented some hack to work around it, but whatever it was, it's gone, and both of those devices are working. Even queries that rely on the search domain are working, and they were definitely broken a few weeks ago. I haven't made any configuration changes in the interim. I'll check some other distros later tonight.

  27. cetex commented on Apr 12, 2018

    @cetex

    Something someone developing systemd-resolved needs to answer is: Why is systemd-resolved not resolving something which is in search domain?

    If i have "search consul" in /etc/resolv.conf systemd-resolved can't resolve anything with *.consul, i only get SERVFAIL back.

    If i remove search domain (Which is a correct domain in our network), systemd-resolved can resolve *.consul again. Resolving *.consul should work in either case.

    If i revert back to dnsmasq things works as expected, *.consul can be resolved with or without search domains specified.

    The fact that resolvconf is doing something weird by not removing old search domains is entirely unrelated, systemd-resolved breaks for some reason when search domains is specified.

  28. earonesty commented on Jul 30, 2018

    @earonesty

    It seems, do me, that the "search" is being used to mean "authoritative" in the 127.0.0.53 underlying resolver, which in turn seems to be a bug in the idea of using a single dns server as "one resolver"

    DNS servers, of course, don't do "search", and cannot be used in place of a resolver.

    Removing the "search" fixes resolution, but the better fix, for me, was simply to remove the systemd resolvconf, and manually create a resolv.conf file.

  29. juresaht2 commented on Nov 25, 2021

    @juresaht2

    For those who are having this issue with the resolution of non-local domains which end with .local . systemd-resolvd will attempt to find an interface with a matching domain on it if it's .local and if it fails, the default nsswitch.conf config will not fall-back to dns as it should, but will stick with the systemd-resolvd error (No appropriate name servers or networks for name found).

    Obviously you shouldn't be using .local domains for anything but mDNS, however if for whatever legacy reasons you are, the solution is to use hosts: files resolve dns in /etc/nsswitch.conf instead of the default line. Then change your resolv.conf from stub to uplink by removing the link at /etc/resolv.conf and replacing it so: ln -s /run/systemd/resolv.conf /etc/resolv.conf. Then systemctl restart systemd-resolved and it should work.

  30. MrEcco commented on May 5, 2026

    @MrEcco

    Thanks for #6976 (comment), but here's a shorter explanation:

    *.local can be resolved only to IP networks of your local interfaces.

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