I just upgraded my Ubuntu 22.04 boxes to 23.10 and then to 24.04.
They stopped resolving DNS queries.
They are using systemd-resolved and resolvconf.
I just upgraded my Ubuntu 22.04 boxes to 23.10 and then to 24.04.
They stopped resolving DNS queries.
They are using systemd-resolved and resolvconf.
If your /etc/resolv.conf file says your nameserver is 127.0.0.53 then you likely are using resolvconf and systemd-resolved.
sudo apt install systemd-resolved
(You might need to temporarily change your /etc/resolv.conf to use a well known dns server directly, like Google's, 8.8.8.8, or CloudFlare's 1.1.1.1, or another one. Note: if installation was partially complete, you may need to do mv /etc/resolv.conf /etc/resolv.conf.orig if it is a symlink, and then add nameserver 1.1.1.1 to it, then don't forget to restore the symlink back once you have fixed the issue.)
For systems that use Debian style /etc/network/interfaces config files makes sure you have dns-nameservers set in the iface section. For example:
auto eth0
iface eth0 inet static
address 1.2.3.4
netmask 255.255.255.0
gateway 1.2.3.1
dns-nameservers 8.8.8.8
If you have a newer install you could instead be using Netplan. The config file is usually /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
enp1s0:
addresses:
- 1.2.3.4/24
routes:
- on-link: true
to: 0.0.0.0/0
via: 1.2.3.1
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.1
Backout any changes made in step 1. to your resolv.conf file. That is, the line with nameserver should just be nameserver 127.0.0.53
Restart networking
systemctl restart systemd-networking
Restart resolved
systemctl restart systemd-resolved
i guess it should use dns specified on netplan config, so this most be a BUG ? anyway, i fixed like this:
change the symbolic link of the resolv.conf to other name:
sudo ln -sf /etc/resolv.custom.conf /etc/resolv.conf
then add your preferred name servers:
sudo nano /etc/resolv.custom.conf
like:
nameserver 8.8.8.8 nameserver 1.1.1.1
instantly solved without any other steps..this way DNS got saved permanently tested with latest ubuntu 24.04