Temporary failure in name resolution on Ubuntu server 22.04.3 LTS

Bo Berglund bo.berglund at gmail.com
Sun Nov 26 09:48:14 UTC 2023


I recently perfored a do-release-upgrade to move the server from 20.04 to
22.04.3 LTS. This is a non-GUI server system.

Now after about a month the DNS system is broken!
I get the error in the subject for instance wen doing:

$ ping www.sunet.com
ping: www.sunet.com: Temporary failure in name resolution

I have googled the problem and the advice I ave found is to edit the
/etc/resolv.conf file and add the google DNS server 8.8.8.8

However this is what the file contains:

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

Notice how I am NOT suposed to edit the file!
And I should use the command to check the state:

$ sudo systemd-resolve --status
sudo: systemd-resolve: command not found

So apparently I am not supposed to edit the resolv.conf file AND I cannot run
the command using systemd.....

What am I supposed to do in order to get the 8.8.8.8 DNS server to work?

I have done a full apt update/upgrade cycle including a reboot  but the error
persists.

Note that if I add a host into the local /etc/hosts file then I get connection
to that server, but that is not a valid solution because it only applies to that
specific host and only as long as it keeps its IP address...


-- 
Bo Berglund
Developer in Sweden




More information about the ubuntu-users mailing list