DNS nameservers are not configured or don't work on Ubuntu 24.04.4 LTS after do-release-upgrade

Ubuntu Version:
Ubuntu 24.04.4 LTS (Noble Numbat) Server running on a VM

Problem Description:
Updated from Ubuntu 22.04.5 LTS (Jammy Jellyfish) to Ubuntu 24.04.4 LTS (Noble Numbat) with do-release-upgrade
Now I have a DNS problem. I have search and tried many suggestions but I just can’t get it to work.
I have found the replace /etc/resolv.conf at boot checkbox of my VM supplier which made debugging hard, but now that it is off it still doesn’t work.

What I’ve Tried:

> ping google.com
ping: google.com: Name or service not known

This means apt update also doesn’t work. So please don’t suggest to apt install X/Y, it doesn’t work.

Failed to fetch ``http://archive.ubuntu.com/ubuntu/dists/noble/InRelease`` Could not resolve ‘``archive.ubuntu.com``’

I have tries all the suggestions I could find and below are my config settings.

> /etc/systemd/resolved.conf
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=9.9.9.9 149.112.112.112 1.1.1.1 
FallbackDNS=1.0.0.1

/etc/resolv.conf → ../run/systemd/resolve/resolv.conf is a symbolic link

> cat /etc/resolv.conf
# This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# <snip>

nameserver 9.9.9.9
nameserver 149.112.112.112
nameserver 1.1.1.1
search .
> cat /etc/resolvconf/resolv.conf.d/base

nameserver 9.9.9.9
nameserver 149.112.112.112
nameserver 1.1.1.1
nameserver 1.0.0.1
> resolvectl status
Global
           Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: uplink
  Current DNS Server: 9.9.9.9
         DNS Servers: 9.9.9.9 149.112.112.112 1.1.1.1
Fallback DNS Servers: 1.0.0.1

Link 2 (venet0)
    Current Scopes: none
         Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
> ls -la /etc/netplan/
total 16
drwxr-xr-x   2 root root  4096 Apr  1 17:13 .
drwxr-xr-x 123 root root 12288 Apr  1 17:13 ..

Empty? Is this relevant and if yes how to get the right config files?

> netplan status
Unknown device type: void
Unknown device type: void
Unknown device type: void
Unknown device type: void
Unknown device type: void
     Online state: offline
    DNS Addresses: 9.9.9.9 (compat)
                   149.112.112.112 (compat)
                   1.1.1.1 (compat)
       DNS Search: .

●  1: lo ethernet UNKNOWN/UP (unmanaged)
      MAC Address: 00:00:00:00:00:00
        Addresses: 127.0.0.1/8
                   ::1/128

●  2: venet0 other UNKNOWN/UP (unmanaged)
        Addresses: 127.0.0.1/32
                   X.X.X.X/32
           Routes: default (boot, link)

Netplan status offline?

> cat /etc/network/interfaces
# This configuration file is auto-generated.
# WARNING: Do not edit this file, otherwise your changes will be lost.
# Please edit template /etc/network/interfaces.template instead.

auto lo
iface lo inet loopback

# Auto generated venet0 interfaces
auto venet0
iface venet0 inet static
	address 127.0.0.1
	netmask 255.255.255.255
	broadcast 0.0.0.0
	up route add default dev venet0
auto venet0:0
iface venet0:0 inet static
	address X.X.X.X
	netmask 255.255.255.255

Adding dns-nameservers 9.9.9.9 149.112.112.112 has no effect.

> systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
     Active: active (running)

> systemctl status systemd-networkd
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; preset: enabled)
     Active: active (running)

>  systemctl status NetworkManager
○ NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
     Active: inactive (dead)

systemctl start NetworkManager has no effect.

> ping -c 3 google.com
ping: google.com: Name or service not known

> ping -c 3 9.9.9.9
PING 9.9.9.9 (9.9.9.9) 56(84) bytes of data.
64 bytes from 9.9.9.9: icmp_seq=1 ttl=55 time=10.0 ms
64 bytes from 9.9.9.9: icmp_seq=2 ttl=55 time=10.1 ms
64 bytes from 9.9.9.9: icmp_seq=3 ttl=55 time=10.0 ms

--- 9.9.9.9 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 10.002/10.030/10.056/0.022 ms

I’m lost.
Any suggestions?

Before Posting:
:mag: Please check if similar issues have already been reported and resolved.

I have checked many issues but in my case it seams that al the relevant config file have the right nameserver 9.9.9.9

I must be missing something.

remove /etc/resolv.conf

make a new one with nameserver 8.8.8.8

sudo systemctl restart NetworkManager
sudo systemctl restart networking
ping -c 3 google.com

I’m on 26.04 so I’m not a perfect copy, but I don’t think restarting NetworkManager does anything in this situation, systemd-resolved is the DNS provider after 24.04.

Basically from what I can see Current Scopes: none should be Current Scopes: DNS if venet0 is your uplink, configure a netplan at /etc/netplan/netplan.yaml and use netplan apply.

Here’s a useful link I found. If this doesn’t help let me know :slight_smile:

I just installed u24 on a VM (proxmox), used all defaults, I can ping google and update.

sudo netplan status gives me

user@u24:~$ sudo netplan status
     Online state: online
    DNS Addresses: 127.0.0.53 (stub)
       DNS Search: lan

●  1: lo ethernet UNKNOWN/UP (unmanaged)
      MAC Address: 00:00:00:00:00:00
        Addresses: 127.0.0.1/8
                   ::1/128

●  2: ens18 ethernet UP (NetworkManager: ens18)
      MAC Address: bc:24:11:af:59:04 (Red Hat, Inc.)
        Addresses: 10.0.0.80/24 (dynamic, dhcp)
                   fe80::be24:11ff:feaf:5904/64 (link)
    DNS Addresses: 10.0.0.1
       DNS Search: lan
           Routes: default via 10.0.0.1 from 10.0.0.80 metric 100 (dhcp)
                   10.0.0.0/24 from 10.0.0.80 metric 100 (link)
                   fe80::/64 metric 256

Neat! Could you share the default netplan it gives you from /etc/netplan/? It’s probably going to be closer to what OP needs than my bare-metal server one.

user@u24:~$ cat /etc/netplan/01-network-manager-all.yaml 
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

/etc/resolv.conf

nameserver 127.0.0.53
options edns0 trust-ad
search lan
1 Like

Thanks everyone.

I need to correct a single item from my original post:
Ubuntu Version:
Ubuntu 24.04.4 LTS (Noble Numbat) Server running on a VPS ↔ not a VM sorry

I tried the last suggestion but ran into a daemon problem.

$ cat 01-network-manager-all.yaml 
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

and then

$ netplan apply
Failed to wait for daemon to reply: Invalid argument
Traceback (most recent call last):
<snip>
subprocess.CalledProcessError: Command '['udevadm', 'control', '--reload']' returned non-zero exit status 1.
$ which udevadm
/usr/bin/udevadm

Now I’m not sure which daemon is needed? Or why it should need udevadm

$ systemctl status netplan
Unit netplan.service could not be found.

There is a netplan-ovs-cleanup service in /run/systemd/system/ but other then that there is no service that looks like it belong to netplan. Not in /etc/systemd/system/ nor in /lib/systemd/system/.

$ systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
     Active: active (running)
$ systemctl status networking
● networking.service - Raise network interfaces
     Loaded: loaded (/usr/lib/systemd/system/networking.service; enabled; preset: enabled)
     Active: active (exited)
$ systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
     Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
     Active: active (running)
$ systemctl status systemd-networkd
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; preset: enabled)
     Active: active (running)

So I’m afraid I need your help a little longer. Should I activate some daemon?

Related question: if I configure renderer: NetworkManager should I not disable systemd-networkd as I understand it is either-or.

A small note, sudo chmod 600 /etc/netplan/01*

-rw------- 1 root root 104 Feb 9 17:32 01-network-manager-all.yaml

sudo netplan apply should not give any warnings about perms too open.

Check. Done that. First time it gave me a permission error but after chmod 600 that was gone.

Could you share your VPS provider? I’d like to see what they’re hosting, based on the network interface it’s OpenVZ under the hood. Based on google searches netplan doesn’t support your interface currently. I’ll see if I can whip something up here locally to test with.

Could you try setting venet0 as a ethernet connection and see what happens with netplan try?