Name resolution does not work when using a fixed IP on ethernet (USB)
Short description: DNS seems not to be working when using a USB network docking bar with fixed IP. Pinging my public DNS IP address works fine, but as soon as I enter a host name, then an error occurs.
Example:
ping puri.sm
ping: puri.sm: Name or service not known
When I use my cellular connection all is working fine. I have received the L5 just a few days ago and managed to install all updates by using the cellular connection.
Details about my setup: (All values are entered in the network settings of the GUI)
Fixed IP address 192.168.0.50 (So no DHCP is used)
Mask 255.255.255.0
Default Gateway 192.168.0.254
DNS server 1: Provider DNS server IP address no 1>
DNS server 2: Provider DNS server IP address no 2>
Routes: Automatic
IP testing
Ping to IP address 127.0.0.1: OK
Ping to IP address L5: OK
Ping to IP address of my default gateway: OK
Ping to IP DNS server 1: OK
Ping to IP DNS server 2: OK
These results tell me that IP connectivity is OK
Ping to a host on the internet: Error Name or service not known
Also used Dig command:
; <<>> DiG 9.16.27-Debian <<>> @<ISP DNS server> puri.sm.
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42654
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;puri.sm. IN A
;; ANSWER SECTION:
puri.sm. 300 IN A 138.68.253.24
;; Query time: 128 msec
;; SERVER: <>#53(<ISP DNS server>)
;; WHEN: Wed Apr 06 01:13:59 CEST 2022
;; MSG SIZE rcvd: 52
Next test done: I’ve added my DNS IP into the file /etc/resolv.conf and tested it without rebooting.
Tested with dnslookup and now name resolution works.
Tested with updating inside Terminal: works
Tested with web-browser: works
Rebooted the L5 and as expected resolv.conf was set back to it’s original state and content and name resolution stopped working.
Result of ifconfig:
enx00e04c1604af: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.50 netmask 255.255.255.0 broadcast 192.168.0.255
ether 00:e0:4c:16:04:af txqueuelen 1000 (Ethernet)
RX packets 56 bytes 3272 (3.1 KiB)
RX errors 0 dropped 30 overruns 0 frame 0
TX packets 39 bytes 5240 (5.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 251467 bytes 20371558 (19.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 251467 bytes 20371558 (19.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
While using the docking bar the content of /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
# No DNS servers known.
search .
Remarks: The USB Hub/Docking bar I’m using is the one from my pinephone Details: USB-C Docking Bar (2x USB Type-A host ports, digital video port, and 10/100Mbps Ethernet port)
In my LAN there is no WiFi and no DHCP server running. All other networking devices in my LAN are setup with fixed IP and name resolution works fine for all of them.
Things I've done and tested are written in my message at the Purism forum