Skip to content

Systemd fails to resolve with specific resolv.conf #7544

Closed

Description

@danielfett

Submission type

  • Bug report

systemd version the issue has been seen with

root@eyjafjallajokull:/etc# systemd --version
systemd 234
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN default-hierarchy=hybrid

Used distribution

Ubuntu 17.10

In case of bug report: Expected behaviour you didn't see

root@eyjafjallajokull:/etc# dig www.uni-stuttgart.de

; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.uni-stuttgart.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26965
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.uni-stuttgart.de.		IN	A

;; ANSWER SECTION:
www.uni-stuttgart.de.	793	IN	A	129.69.8.151

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Dec 05 11:42:59 CET 2017
;; MSG SIZE  rcvd: 65

root@eyjafjallajokull:/etc# systemd-resolve www.uni-stuttgart.de
www.uni-stuttgart.de: 2001:7c0:2041:8::151
                      129.69.8.151

-- Information acquired via protocol DNS in 6.1ms.
-- Data is authenticated: no

In case of bug report: Unexpected behaviour you saw

root@eyjafjallajokull:/etc# dig www.uni-stuttgart.de

; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.uni-stuttgart.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5557
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;www.uni-stuttgart.de.		IN	A

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Dec 05 11:44:56 CET 2017
;; MSG SIZE  rcvd: 49

root@eyjafjallajokull:/etc# systemd-resolve www.uni-stuttgart.de
www.uni-stuttgart.de: resolve call failed: No appropriate name servers or networks for name found

In case of bug report: Steps to reproduce the problem

Behavior depends on /etc/resolv.conf:

Not working:

nameserver 127.0.0.53
search sec.uni-stuttgart.de rus.uni-stuttgart.de uni-stuttgart.de

Working:

nameserver 127.0.0.53
search sec.uni-stuttgart.de rus.uni-stuttgart.de

Resolved status:

root@eyjafjallajokull:/etc# systemd-resolve --status
Global
          DNS Domain: sec.uni-stuttgart.de
                      rus.uni-stuttgart.de
                      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 4 (enp0s20f0u2c2)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

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

Link 2 (enp0s31f6)
      Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 129.69.211.1
                      129.69.215.5
                      2001:7c0:2015:182::3
          DNS Domain: sec.uni-stuttgart.de

Activity

  1. keszybz commented on Dec 5, 2017

    @keszybz
    Member

    Hmmm, are you sure this is a problem on systemd's side?
    dig www.uni-stuttgart.de @129.69.215.5 fails, as does dig www.uni-stuttgart.de @129.69.211.1. So maybe resolved is querying those servers and getting a failure from them?

  2. added
    needs-reporter-feedback ❓
    on Dec 5, 2017
  3. danielfett commented on Dec 5, 2017

    @danielfett
    Author

    I'm inside the network for which 129.69.215.5 and .211.1 are answering DNS requests, so they work fine for me:

    fett@eyjafjallajokull:~$ dig @129.69.211.1 www.uni-stuttgart.de
    
    ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @129.69.211.1 www.uni-stuttgart.de
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16735
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 11
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;www.uni-stuttgart.de.		IN	A
    
    ;; ANSWER SECTION:
    www.uni-stuttgart.de.	816	IN	A	129.69.8.151
    
    ;; AUTHORITY SECTION:
    de.			82925	IN	NS	l.de.net.
    de.			82925	IN	NS	s.de.net.
    de.			82925	IN	NS	n.de.net.
    de.			82925	IN	NS	a.nic.de.
    de.			82925	IN	NS	f.nic.de.
    de.			82925	IN	NS	z.nic.de.
    
    ;; ADDITIONAL SECTION:
    a.nic.de.		10576	IN	A	194.0.0.53
    a.nic.de.		157338	IN	AAAA	2001:678:2::53
    f.nic.de.		12336	IN	A	81.91.164.5
    f.nic.de.		12336	IN	AAAA	2a02:568:0:2::53
    l.de.net.		70292	IN	A	77.67.63.105
    l.de.net.		70292	IN	AAAA	2001:668:1f:11::105
    n.de.net.		65824	IN	A	194.146.107.6
    n.de.net.		65824	IN	AAAA	2001:67c:1011:1::53
    s.de.net.		70292	IN	A	195.243.137.26
    z.nic.de.		12336	IN	A	194.246.96.1
    
    ;; Query time: 0 msec
    ;; SERVER: 129.69.211.1#53(129.69.211.1)
    ;; WHEN: Tue Dec 05 13:42:42 CET 2017
    ;; MSG SIZE  rcvd: 379
    
  4. danielfett commented on Dec 5, 2017

    @danielfett
    Author

    Also I don't see any network traffic (using wireshark) when trying to resolve the requests. It therefore is most likely a local issue.

  5. keszybz commented on Dec 5, 2017

    @keszybz
    Member

    Can you run systemd-resolved with SYSTEMD_LOG_LEVEL=debug and paste the logs here?

  6. danielfett commented on Dec 5, 2017

    @danielfett
    Author

    Sure:

    fett@eyjafjallajokull:~$ dig www.uni-stuttgart.de
    
    ; <<>> DiG 9.10.3-P4-Ubuntu <<>> www.uni-stuttgart.de
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 584
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;www.uni-stuttgart.de.		IN	A
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Tue Dec 05 13:46:19 CET 2017
    ;; MSG SIZE  rcvd: 49
    
    fett@eyjafjallajokull:~$ Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Got DNS stub UDP query packet for id 18434
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Looking up RR for www.uni-stuttgart.de IN A.
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Cache miss for www.uni-stuttgart.de IN A
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Transaction 33616 for <www.uni-stuttgart.de IN A> scope dns on */*.
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Transaction 33616 for <www.uni-stuttgart.de IN A> on scope dns on */* now complete with <no-servers> from none (unsigned).
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Freeing transaction 33616.
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Sending response packet with id 18434 on interface 1/AF_INET.
    Dez 05 13:46:19 eyjafjallajokull systemd-resolved[437]: Processing query...
    
  7. removed
    needs-reporter-feedback ❓
    on Dec 6, 2017
  8. keszybz commented on Dec 6, 2017

    @keszybz
    Member

    Looks like a duplicate of #6976

  9. poettering commented on Dec 8, 2017

    @poettering
    Member

    So, resolved actually works 'correctly' here, even though that might be surprising. Your configuration is like this:

    1. route sec.uni-stuttgart.de rus.uni-stuttgart.de uni-stuttgart.de to the global DNS server
    2. configure no global DNS server
    3. route sec.uni-stuttgart.de to enp0s31f6
    4. configure 3 DNS servers to enp0s31f6

    Note that the the per-interface DNS server + search domains are considered one unit each, and so are the global DNS server + global search domains. This means that the global DNS servers are used for the globally configured search domains, and the per-interface DNS server for the the per-interface configured search domain... But you didn't actually configure any global DNS server (the only server you configured is resolved itself on 127.0.0.53, which resolved is smart enough to ignore, in order to avoid loopback queries), hence you get the error you get: "no configured DNS servers for query"...

    (note that this all won't affect if you resolve names in unrelated domains. For example if you try to resolve github.com, none of the configured domains apply, and hence we'll route the query to both the global DNS server (but there are none, so this has no effect) and the per-interface ones, which will succeed)

    Now, there's a disconnect between how resolved understands your configuration and what you are actually trying to configure I presume? You wanted to say: regardless which interface, please use these search domains, right? I figure that is a valid request, but we'd have to rework search domain handling to make that possible, and interpret domains configured through /etc/resolv.conf differently than we currently do, i.e. disconnect them from the DNS servers configured that way...

    Does this make sense?

  10. poettering commented on Dec 8, 2017

    @poettering
    Member

    I prepped PR #7588 which improves the situation a bit: when figuring out where to route lookup requests to, we'll no longer consider scopes that have no DNS server configured. This doesn't make available what @webhamster is trying to do, but is generally an improvement, and at least will not break resolution if domains are configured without matching DNS servers.

  11. poettering commented on Dec 8, 2017

    @poettering
    Member

    And yes, this is a duplicate of #6976

  12. poettering commented on Dec 8, 2017

    @poettering
    Member

    Closing as duplicate of #6976

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions