DNS resolving issue with fixed IP setting (USB network)

Hi everybody,

I’ve just received my L5 and ran into my first issues.

  1. DNS seems not to be working when using a USB network hub.
    Pinging my public DNS IP address works fine, but as soon as I enter a host name, then an error occurs.

Example:
ping ns1.cloudfare.com
ping: ns1.cloudfare.com: Name or service not known

When I use my cellular connection all is working fine.

  1. The dialogs of network-manager aren’t fitting the screen (too large).
    This makes it difficult to change settings. Is there a way to change this?

Remark:
The USB Hub I’m using is the one from my pinephone

What about when you use WiFi (no hub and no cellular)?

Can you provide more details about the USB hub? Is this more like a dock?

You should be able to scale the screen so that the windows fit (but they then may or may not be too small to be readable).

In the failing USB case also the the content of the file /etc/resolv.conf would be of interest.

Hi Irvinewade,
There is not much to tell, but a picture is as good as 1000 words:
Pinehone docking bar

Added:
USB-C Docking Bar:
2x USB Type-A host ports, digital video port, and 10/100Mbps Ethernet port

It is listed on the compatibility list for L5, so I do not expect it’s the cause the problem.

About WiFi: Well there’s no WiFi available at my place :scream:

About fitting the dialogs to the screen: How do I accomplish this?

Hi Guru,

Here is the requested info from /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 .

That’s the wrong config file.

With cellular and WiFi killed with their switches, and the dock connected, what does ifconfig show?

I assume that the ethernet port on the dock is successfully connected to something. Connected to what? Bear in mind that the phone will have a completely different MAC address on your LAN if you connect via the dock, as compared with via WiFi.

Sorry, my response to you has been changed while you were posting.
I have no WiFi at my place.

I’m using my LAN for local and internet connections.
SSH communications between the L5 (using the dock) and my PC (same IP range) are working fine.

And you are right about the conf data.
I have mistakenly copied the wrong content (corrected this).

Looking at the resolv.conf content:

Strange, I have 2 DNS servers configured in my network setup.
Yet it fails to find them.
I’ve pinged them again and do get a reply from both of them.

So these are your own DNS servers that you have explicitly set up? Obviously only you know whether you have any firewall or security rules that might prevent use of the DNS servers by the Librem 5.

Anyway, as ping has worked, you want to do nslookup on the Librem 5 and then at the prompt
server aaa.bbb.ccc.ddd
and then some domain e.g. ns1.cloudflare.com.
(note the trailing dot)
for each of your two DNS servers.

You may want to see about enabling logging for a DNS server to shed light on what is going wrong.

Looking at /etc/resolv.conf though it seems the problem may be with DHCP, if you are using it for the Librem 5 to get an IP address. Are you running your own DHCP server?

Hi again,

First I apologize for the confusion.
Let me try again explaining how my network setup looks like and what I have been testing.

I’m using Ethernet over USB as described in my 1st and 3rd msg.
This interface has been configured as:
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
I’m not a Linux guy but have been playing around with the OS for a while now.
Some things I have discovered, but many things are new to me. :confused:

I’ve tried using dnslookup but the cli retuns the error: command not found.
Installing dnsutils fail with error: Unable to locate package dnsutil
So this tool I cannot use for troubleshooting.

Did you spell cloudflare correctly on the device? (Above is misspelled.)

In the L5’s Settings, find Displays, then choose a smaller scale.

2 Likes

The package is dnsutils with an ‘s’

Instead of nslookup you can use dig e.g.

dig @server +noall +answer ns1.cloudflare.com.

where you replace server with the IP address of one of your DNS servers. For me the output is e.g.
ns1.cloudflare.com. 14215 IN A 173.245.58.100

You have to configure a DNS Server. Without one, your System can not resolve a Domain Name to an IP Adress. And you may have to add a (default) Route for Internet Access.

Example:
Your Router: 192.168.0.254
Your DNS-Server: 192.168.0.40

So how you can use it?
Open a Terminal and run:

root # echo "nameserver 192.168.0.40" >> /etc/resolv.conf

If you are not root, you can add a sudo in front.

user $ sudo echo "nameserver 192.168.0.40" >> /etc/resolv.conf

Instead of using echo you can open /etc/resolv.conf with your favorite editor and insert the Line at the end of that File without “#” the commentary mark in that line.
(To undo that you set a commentary mark in front of the added line or delete it later.)

Whatch at all your Network Devices:

 user $ ifconfig -a

And this will print your Routes:

 user $ route

An example to set your default Route, to your LAN Gateway IP:

 user $ sudo add default gw 192.168.0.254

And if you do not need it anymore:

 user $ sudo del default gw 192.168.0.254

If you are from Europe and have less Network-Hops to: 46.182.19.48

You can use that Dns-Server IP instead of your local one, its from the German association Digitalcourage.

If you can ping it, you can use it too - if you have trust.

No, you can’t. If I had a dollar for every time this comes up, well OK I wouldn’t be able to afford another Librem 5 but still … :slight_smile:

The shell handles I/O redirection e.g. >> before sudo runs. So you need read access (for <) or otherwise write access in your own right in order to do it this way, in which case you don’t need sudo at all.

I think you are missing route in there i.e. sudo route add ...

Assuming that the DNS servers belong to the OP’s ISP (or anyone else on the internet) then there appears to be a reasonable default gateway - although we are missing actual ifconfig output. The OP says that ping to the DNS server works, so the default gateway should be OK.

@ Hostname: I’ve used several host names, all fail.

@Display scale: I’m back to 100%. That is better, but not enough to see all buttons.

1 Like

@Christal: Default gateway and DNS servers are all entered and pinging them works fine.
That part of my network stack is OK.

@ Irvinewade
What surprises me is that ifconfig, dig nslookup all are not available/installed.
Are these not installed by default?

OK, I’ve installed dig by using my cellular connection.
I switched back to my USB network connection and tried to use “dig puri.sm”.

purism@pureos:~$ dig puri.sm

; <<>> DiG 9.16.27-Debian <<>> puri.sm
;; global options: +cmd
;; connection timed out; no servers could be reached

Same for:

dig <My DNS IP> +noall +answer ns1.cloudflare.com

The results of ifconfig are:

        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

I guess not. There’s no hard and fast rule. They aren’t essential to operation of the device - so maybe Purism is being more efficient in the use of disk space. For my money they should be installed though.

OK, so did you have an @ sign in front of the IP address?

Can you please be explicit: where are the DNS servers? Are they on your local network? Are they on the internet? Are they public DNS servers (like an ISP’s or Google’s or Cloudflare’s or …) or are they private DNS servers (employer’s or yours on VPSs or …)?

When diagnosing DNS problems … note the trailing dot - a hostname (like puri.sm) should be specified with a trailing dot (puri.sm.). A lot of the time it won’t make any difference but if you know you are having DNS problems, it could make a difference.

Can you confirm that this choice of the two DNS servers does work from other computers on your LAN?

This PC that you mention, is it running Linux or something else?

I’ve not used the “@” in front of the IP address.
Have done that now and the results are different:

; <<>> 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

The DNS servers are the servers from my ISP and they (DNS servers) are not within my network.
The settings work fine for all other computers within my LAN.
As asked, the PC that I’m currently using is a Windows PC.

OK then I think the answer is clear. However you managed to configure the DNS server IP addresses into the interface on the Librem 5, it didn’t have the desired effect e.g. doesn’t show up in /etc/resolv.conf

How much troubleshooting do you want to do?

You could take a punt and just edit the DNS server IP addresses into that file - syntax is e.g.
nameserver 1.1.1.1
(repeat such a line for each DNS server IP address)

(when things are working properly or half-working, changes to that file will get wiped out when you reboot but if things are really not working then changes won’t get wiped out)

or you would need to see, at least, whether the systemd-resolved service is starting properly e.g.
systemctl status systemd-resolved

and I would probably check NetworkManager too e.g.
systemctl status NetworkManager

or you could try changing your approach and use DHCP instead. You may have good reasons for wanting to avoid DHCP.

You may want to see whether there is any useful error message in the journal e.g.
journalctl | grep 'Apr 06' | grep enx00e04c1604af

NetworkManager stores settings in files in /etc/NetworkManager/system-connections so you might want to see how many files are in there, whether one obviously associates with your dock’s ethernet connection, and whether it obviously has the right or wrong DNS server IP addresses.

NB: Files in that directory are protected against read access i.e. to examine the content of such a file you would need
sudo cat /etc/NetworkManager/system-connections/whatever.nmconnection