DNS issues on Ubuntu 22.04.3 headless server


Trying to configure a headless plex server on a little Optiplex machine I bought. Everything has gone smoothly until I try to claim my plex server and it turns out there are DNS issues on the server. I’m running Ubuntu 22.04.3

I should preface this by mentioning I have a PiHole, but by router settings do not force all client traffic to the PiHole’s DNS server ("DNS Director" is disabled in my ASUS router running merlin). I’ve successfully circumvented the PiHole on my partner’s laptop by manually setting the DNS locally, and that’s been working great for years. I assume DNS settings on the Ubuntu server would also circumvent the PiHole, and I’m able to temporarily disable the PiHole to check this.

At some point when trying to enable a static IP, I installed NetworkManager, which although I understand isn’t standard practice on a headless machine, it might be more risky to try and disable it now.


DNS isn’t working, as far as I can tell. I can ping an ip address

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=58 time=11.0 ms
64 bytes from icmp_seq=2 ttl=58 time=12.0 ms
64 bytes from icmp_seq=3 ttl=58 time=8.91 ms
64 bytes from icmp_seq=4 ttl=58 time=13.1 ms
64 bytes from icmp_seq=5 ttl=58 time=11.6 ms
64 bytes from icmp_seq=6 ttl=58 time=11.5 ms
--- ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5008ms
rtt min/avg/max/mdev = 8.911/11.358/13.082/1.262 ms

but I can’t ping a URL

ping: https://www.plex.tv/: Name or service not known


ping: https://www.google.com: Name or service not known

What I’ve Tried

I deleted /etc/resolv.conf, also removing the symlink between /etc/resolv.conf and /run/resolvconf/resolv.conf. I edited NetworkManager.conf to force NetworkManager to re-create resolv.conf. Below is NetworkManager.conf:




and here is the brand new resolv.conf, which is sitting in /etc with no symlink anymore:

# Generated by NetworkManager

Here is my netplan, I’ve rebuilt using netplan try and netplan apply (when root)

  renderer: NetworkManager
      dhcp4: true
  version: 2

Other (Useful?) Information

Here is the output of nmcli device status

enp0s31f6  ethernet  connected  static-ip
lo         loopback  unmanaged  --

and the output of sudo ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 18:66:da:43:cb:68 brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute enp0s31f6
       valid_lft forever preferred_lft forever
    inet6 fe80::5159:dbb8:4452:adaa/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

Testing using DiG:

; <<>> DiG 9.18.12-0ubuntu0.22.04.2-Ubuntu <<>> @ www.ubuntu.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48879
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;www.ubuntu.com.                        IN      A

www.ubuntu.com.         14      IN      A
www.ubuntu.com.         14      IN      A
www.ubuntu.com.         14      IN      A

;; Query time: 8 msec
;; WHEN: Wed Aug 23 14:30:08 UTC 2023
;; MSG SIZE  rcvd: 91

Next Steps?

The next thing I was thinking to investigate is whether I should add another configuration to the .yaml configuration for the ethernet interface, since it’s just the static ip interface that’s configured right now. Examining the configuration using nmtui shows the ethernet interface enp0s31f6 is just configured automatically:

nmtui screenshot of enp0s31f6 interface

If you made it through all this, thank you! I’ve searched many threads over the past few days, learning a lot about how Linux network configuration works, but after several hours I seem to be pretty stuck. Any help would be greatly appreciated before I accidentally break something 🙂

Asked By: ad01


Which command to you use to ping a DNS name?

You must do like this:

$ ping google.com
PING google.com ( 56(84) bytes of data.
64 bytes from arn09s23-in-f14.1e100.net ( icmp_seq=1 ttl=58 time=15.3 ms
64 bytes from arn09s23-in-f14.1e100.net ( icmp_seq=2 ttl=58 time=14.3 ms
64 bytes from arn09s23-in-f14.1e100.net ( icmp_seq=3 ttl=58 time=16.5 ms
64 bytes from arn09s23-in-f14.1e100.net ( icmp_seq=4 ttl=58 time=14.3 ms

Whereas this will give an error:

$ ping https://www.google.com
ping: https://www.google.com: Name or service not known

You cannot ping a http/https URL, since ping knows nothing about http/https protocols.

So based on what you have included in your question, I don’t think you have a DNS problem at all.

Answered By: Artur Meinild