Linux Name Resolution (DNS) Failure

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
nburkitt
Posts: 4
Joined: Fri 23. Apr 2021, 23:47

Linux Name Resolution (DNS) Failure

Post by nburkitt » Fri 30. Apr 2021, 19:51

Hi.
I'm using a PEAK PCAN-USB FD interface on an embedded device running Ubuntu 18.04 Linux. It works beautifully, but as soon as the device is connected, DNS queries begin to fail. After some research, I've come to believe that this is due to the systemd network service incorporating the CAN bus into the name resolution algorithm.
Obviously this isn't a PEAK issue, but does anyone on the forum have any insight into how to prevent or work around this problem?
Thanks,
-Nick

M.Heidemann
Sales & Support
Sales & Support
Posts: 538
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Name Resolution (DNS) Failure

Post by M.Heidemann » Mon 3. May 2021, 07:58

Hello Nick,

Which driver are you currently using with your PCAN-USB FD?

Are you using the mainline drivers included in the kernel or are you
using the PCAN-Linux driver package?
If you use the latter, we suspect your use the NetDev variant?

Please let us know.

Best Regards

Marvin

M.Heidemann
Sales & Support
Sales & Support
Posts: 538
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Name Resolution (DNS) Failure

Post by M.Heidemann » Mon 3. May 2021, 10:16

Furthermore,

Usually the CAN interfaces are not set up to handle DNS,
a output for "resolvectl status" would show a CAN-Interface configured like this:

Code: Select all

Link 4 (can0)
      Current Scopes: none
DefaultRoute setting: no  
       LLMNR setting: yes 
MulticastDNS setting: no  
  DNSOverTLS setting: no  
      DNSSEC setting: no  
    DNSSEC supported: no  
Please check wether or not the CAN-interface is set in
/etc/systemd via:

Code: Select all

find /etc/systemd/ -name "can*"
and

Code: Select all

grep -R can0 /etc/systemd/
Please report back to us regarding this.

Best Regards

Marvin

nburkitt
Posts: 4
Joined: Fri 23. Apr 2021, 23:47

Re: Linux Name Resolution (DNS) Failure

Post by nburkitt » Mon 3. May 2021, 19:58

Hi Marvin.

Thanks for the response.
I'm using the built-in drivers.
The information returned by "systemd-resolve --status" includes this section:

Code: Select all

Link 9 (can0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
For what it's worth, this is identical to the section for eth0, an interface for which name resolution works correctly when the CAN interface is not attached:

Code: Select all

Link 2 (eth0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
"find /etc/systemd/ -name "can*"" produces no output.
"grep -R can0 /etc/systemd/" produces no output (other than "grep: /etc/systemd/system/multi-user.target.wants/lm-sensors.service: No such file or directory").

Thanks again,

-Nick

M.Heidemann
Sales & Support
Sales & Support
Posts: 538
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Name Resolution (DNS) Failure

Post by M.Heidemann » Tue 4. May 2021, 09:59

Hello,

Is the output for

Code: Select all

systemd-resolve --status
regarding Link2 (Eth0) the same,
if the PCAN-USB FD is not connected?

Please report back to us reagrding this.

Best Regards

Marvin

nburkitt
Posts: 4
Joined: Fri 23. Apr 2021, 23:47

Re: Linux Name Resolution (DNS) Failure

Post by nburkitt » Tue 4. May 2021, 18:25

Hi Marvin.

Yes, the output when the PCAN-USB FD is connected is identical to that when it is not connected, except for the addition of the (can0) section. The output for both conditions is below.

PEAK CAN-FD not attached:

Code: Select all

# systemd-resolve --status
Global
         DNS Servers: 192.168.0.1
          DNS Domain: attlocal.net
          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 (sit0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (eth0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
PEAK CAN-FD attached:

Code: Select all

# systemd-resolve --status
Global
         DNS Servers: 192.168.0.1
          DNS Domain: attlocal.net
          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 9 (can0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

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

Link 2 (eth0)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
Additionally, without the PCAN-USB-FD attached, queries via nslookup succeed:

Code: Select all

# nslookup google.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.1.238
Name:   google.com
Address: 2607:f8b0:4007:814::200e
With the PCAN-USB-FD attached, they fail:

Code: Select all

# nslookup google.com
Server:         127.0.0.53
Address:        127.0.0.53#53

** server can't find google.com: SERVFAIL
But if I specify the DNS server to use, they succeed:

Code: Select all

# nslookup google.com 192.168.0.1
Server:         192.168.0.1
Address:        192.168.0.1#53

Non-authoritative answer:
Name:   google.com
Address: 64.233.177.100
Name:   google.com
Address: 64.233.177.139
Name:   google.com
Address: 64.233.177.113
Name:   google.com
Address: 64.233.177.101
Name:   google.com
Address: 64.233.177.138
Name:   google.com
Address: 64.233.177.102
Name:   google.com
Address: 2607:f8b0:4002:810::200e
Thanks again for your help with this.

-Nick

M.Heidemann
Sales & Support
Sales & Support
Posts: 538
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Name Resolution (DNS) Failure

Post by M.Heidemann » Wed 5. May 2021, 12:08

Hi Nick,

Please check "/etc/systemd/resolved.conf", is any DNS configured?

Do you have a Fallback DNS configured?

Please check this, configure both if necessary and check if that resolved the
issue.

Please report back to us, if this has changed anything for you.
Possibly a service is also handling DNS settings, you might want
to check this for your Distro and if other users experience similar issue (with any plug&play network device)

Best Regards

marvin

nburkitt
Posts: 4
Joined: Fri 23. Apr 2021, 23:47

Re: Linux Name Resolution (DNS) Failure

Post by nburkitt » Fri 7. May 2021, 18:28

Hi Marvin.

DNS is configured via DHCP. "/etc/systemd/resolved.conf" is effectively empty, which should be correct for that configuration. Remember, name resolution works correctly when the PCAN-FD-USB interface is not attached.
I've tried disabling the Avahi (mDNS/Bonjour/Zeroconf) service, but this had no effect on the problem.
Thanks,

-Nick

M.Heidemann
Sales & Support
Sales & Support
Posts: 538
Joined: Fri 20. Sep 2019, 13:31

Re: Linux Name Resolution (DNS) Failure

Post by M.Heidemann » Mon 10. May 2021, 16:30

Hello,

Are you able to reproduce this issue,
when another network-adaptor is added instead of the PCAN-USB FD(a usb-wifi dognle, for example)?

Please let us know.

Best Regards

Marvin

Post Reply