Skip to content

scoped DNS lookup going over incorrect interface #10830

Closed

Description

@grooverdan

systemd version the issue has been seen with

v239 / commit b8cb5ef

Used distribution

fc29

Expected behaviour you didn't see

DNS resolution of w3.ibm.com via vpn0 interface because of DNS server ibm.com entry.

Unexpected behaviour you saw

resolution via wlp4s0

$ resolvectl status
Global
       LLMNR setting: yes
MulticastDNS setting: yes
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: no
Fallback DNS Servers: 8.8.8.8
                      8.8.4.4
                      2001:4860:4860::8888
                      2001:4860:4860::8844
          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 8 (vpn0)
      Current Scopes: DNS
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
  Current DNS Server: 9.0.146.50
         DNS Servers: 9.0.144.50
                      9.0.146.50
          DNS Domain: ibmuc.com
                      ibmmodules.com
                      s81c.com
                      lotus.com
                      ibm.com

Link 7 (br-c5bddbdbc8b5)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

Link 6 (docker0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

Link 5 (virbr0-nic)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

Link 4 (virbr0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

Link 3 (wlp4s0)
      Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes
  Current DNS Server: 192.168.178.1
         DNS Servers: 192.168.178.1
                      fd00::a96:d7ff:fe39:3b4e
          DNS Domain: ~.
                      fritz.box

Link 2 (enp0s31f6)
      Current Scopes: none
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: fd69:d75f:b8b5:61::1
          DNS Domain: ~.
                      ozlabs.ibm.com
                      au.ibm.com
                      ibm.com
                      aus.stglabs.ibm.com
$ resolvectl flush-caches 
$ resolvectl query w3.ibm.com
w3.ibm.com: resolve call failed: 'w3.ibm.com' does not have any RR of the requested type
...
Validating response from transaction 13601 (ibm.com IN SOA).
Looking at ibm.com IN SOA asia3.akam.net dnsadm.us.ibm.com 1542444154 43200 7200 604800 3600: no-signature
Found verdict for lookup ibm.com IN SOA: insecure
Added positive unauthenticated cache entry for ibm.com IN SOA 6910s on */INET/192.168.178.1
Transaction 13601 for  on scope dns on wlp4s0/* now complete with  from network (unsigned).
Validating response from transaction 47759 (w3.ibm.com IN DS).
Looking at ibm.com IN SOA asia3.akam.net dnsadm.us.ibm.com 1542444154 43200 7200 604800 3600: no-signature
Found verdict for lookup ibm.com IN SOA: insecure
Found verdict for lookup w3.ibm.com IN DS: insecure
Added NODATA cache entry for w3.ibm.com IN DS 3410s
Transaction 47759 for  on scope dns on wlp4s0/* now complete with  from network (unsigned).
Validating response from transaction 62670 (w3.ibm.com IN SOA).
Looking at ibm.com IN SOA asia3.akam.net dnsadm.us.ibm.com 1542444154 43200 7200 604800 3600: no-signature
Found verdict for lookup ibm.com IN SOA: insecure
Found verdict for lookup w3.ibm.com IN SOA: insecure
Transaction 62670 for  on scope dns on wlp4s0/* now complete with  from network (unsigned).
Validating response from transaction 48080 (w3.ibm.com IN AAAA).
Looking at ibm.com IN SOA asia3.akam.net dnsadm.us.ibm.com 1542444154 43200 7200 604800 3600: no-signature
Found verdict for lookup ibm.com IN SOA: insecure
Found verdict for lookup w3.ibm.com IN AAAA: insecure
Added NODATA cache entry for w3.ibm.com IN AAAA 2144s
Transaction 48080 for  on scope dns on wlp4s0/* now complete with  from network (unsigned).
Validating response from transaction 7252 (w3.ibm.com IN A).
Looking at ibm.com IN SOA asia3.akam.net dnsadm.us.ibm.com 1542444154 43200 7200 604800 3600: no-signature
Found verdict for lookup ibm.com IN SOA: insecure
Found verdict for lookup w3.ibm.com IN A: insecure
Added NODATA cache entry for w3.ibm.com IN A 2144s
Transaction 7252 for  on scope dns on wlp4s0/* now complete with  from network (unsigned).
Freeing transaction 48080.
Freeing transaction 4746.
Sent message type=error sender=n/a destination=:1.729 path=n/a interface=n/a member=n/a cookie=119 reply_cookie=2 signature=s error-name=org.freedesktop.resolve1.NoSuchRR error-message='w3.ibm.com' does not have any RR of the requested type

Steps to reproduce the problem

Bring up VPN.

Attempt resolution of VPN only DNS entries.

Activity

  1. added
    bug 🐛
    on Nov 19, 2018
  2. mdunc commented on Dec 3, 2018

    @mdunc

    I think this was also reported over a year ago here which was quickly flagged as "not-our-bug" (incorrectly in my opinion) - #6076 (comment)

    I'm having a very similar problem, if not the exact same problem and I commented with my config and logs in that issue. I suspect the people who can do anything about it have all muted notifications for that issue though. I really hope to see this fixed as DNS resolution over my company's VPN is pretty broken out of the box in Ubuntu now because of this.

  3. grooverdan commented on Dec 3, 2018

    @grooverdan
    ContributorAuthor

    The above issue seem to refer at least 2 things, missing DNS Domain, and a set domain like you had @mdunc (but I'm expecting a split DNS system with a VPN).

    In this case I've got the enp0s31f6 and vpn0 both having a DNS Domain of ibm.com and the DNS query is going out the default ('~.') interface wlp4s0 for a w3.ibm.com query that I think should hit a more specific interface. The interface enp0s31f6 is actually down however remains residual in resolvectl status.

  4. poettering commented on Dec 4, 2018

    @poettering
    Member

    So this is actually a misconfiguration, because the "~." line binds all lookups to both wlp4s0 and enp0s31f6. Drop it from both and things should work the way you want this to work.

    I'll shortly submit a patch that makes this work more like it assumed it works (but how it previously didn't): instead of routing DNS traffic to all links that have a matching domain only route it to the links with the "best matching" domains.

  5. poettering commented on Dec 4, 2018

    @poettering
    Member

    Fix waiting in #11050

  6. teatreeoilchocolate commented on Jul 19, 2020

    @teatreeoilchocolate

    One thing I like to point out to all those coming to this thread and reading about "This is not working!", "This is not our bug!", etc.
    From one who is not involved in systemd(besides being a fan): It actually works.
    The DNS-DHCP-Configuration I mentioned this in is a slightly different matter.
    I also stumbled across this via a DNS-Leak.
    The misconfiguration on my system was due to a DHCP-daemon(not a good idea, and worrysome considering that you have multiple IP-addresses all of the sudden and then what traffic goes over what ..... -.-' )
    If you look at the content of the symlinked file
    % cat /etc/resolv.conf and you do not find 127.0.0.53 listed there as a nameserver,it is a strong idication that you have a DHCP-daemon running, which writes to /etc/resolv.conf.
    And these daemons work side-by-side without a problem save DNS-resolutions.(Thankfully)
    And that is also the reason it might not get caught.

    I undertook the following steps to fix the leak.
    After those steps the DNS-server reported to be leaking was found to be Packet Clearing House in Prague, which is collaborating with Quad9. And Quad9 is what I configured as a DNS-Server in tun0.network.

    1. Disable dhcpcd (note not just stopping it but disabling it)
    2. add a DNS-server in /etc/systemd/resolved.conf
    3. set UseDNS=false for your tun-interface(vpn)and your network using systemd.network, I didn't bother to check if would also work with UseDNS=true as I am currently only working with VPN-enabled, but coffeeshop time will be upon me again and then I will know.
    4. Disconnect networks
    5. execute systemctl daemon-reload && systemctl restart systemd-networkd && systemctl restart systemd-resolved
    6. connect to networks
    7. you will find /run/systemd/resolve/stub-resolv.conf to contain 127.0.0.53 still and /run/systemd/resolve/resolv.conf the nameservers in an order which makes the DHCP one not being used(that is what ticket [networkd] description of UseDNS= / UseDomains= #9473 is about not this one)
    8. Visit a website to check for DNS-leaks (e.g. https://www.dnsleaktest.com/) and you will find that the name-server you configured in /etc/systemd/resolved.conf is being used.
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

    bug 🐛resolve

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions