On this pageWhat the message means
"Temporary failure in name resolution" means the resolver asked for an address and got no usable answer. It does not mean the domain is gone. That distinction is where the fix starts: the name is usually fine, and something between the program and the DNS servers is broken. The steps below assume a Linux server, with notes for Ubuntu's systemd-resolved, NetworkManager systems, Docker and WSL.
What the message means
Programs look names up through the C library's getaddrinfo(). When it gives up because no server answered, or a server replied with a failure, tools print this message. A different message appears when a server answers definitively that the name has no address.
| Message | What happened | Where to look |
|---|---|---|
Temporary failure in name resolution |
No usable answer: timeout, unreachable server or server failure | Network, resolver setup, upstream servers |
Name or service not known |
A clear answer: the name does not exist or has no address | Spelling, the DNS records |
Temporary failure resolving 'archive.ubuntu.com' |
apt's wording for the first case | Same as the first |
sudo: unable to resolve host web-01 |
The machine cannot resolve its own name | /etc/hosts |
Triage in four commands
ping -c 2 9.9.9.9 # 1. can the server reach the internet at all?
getent ahosts example.com # 2. what the system resolver returns, the same path apps use
resolvectl status # 3. which DNS servers systemd-resolved uses, per interface
dig @9.9.9.9 example.com +short # 4. does a public resolver answer when asked directly?
Read the results together:
- Step 1 fails: this is not a DNS problem. Fix routing or the network interface first.
- Steps 1 and 4 work, step 2 fails: the local resolver configuration is broken.
- Step 1 works, step 4 times out: something blocks outbound DNS.
If the network filters ping, nc -vz 9.9.9.9 53 tests the same path over TCP. dig comes from the bind9-dnsutils package on Debian and Ubuntu and from bind-utils on the RHEL family. Step 3 only applies where systemd-resolved runs.
Fixes, from the bottom up
No address or no default route
ip -br addr should show the main interface UP with its address, and ip route should start with default via. If either is missing, DNS fails as a side effect. A recent netplan or NetworkManager change is the usual suspect: revert it, or test the next attempt with sudo netplan try, which rolls back unless you confirm. If an edit cut the server off completely, work from the provider's console instead of SSH. On CloudSat, request console access from the server's Access tab, as described in the recovery tools guide.
/etc/resolv.conf is missing or points nowhere
On Ubuntu, /etc/resolv.conf is normally a symlink to /run/systemd/resolve/stub-resolv.conf, which lists the local stub at 127.0.0.53. It breaks when someone replaces the link with a static file, a VPN client rewrites it, or systemd-resolved stops and the target disappears.
ls -l /etc/resolv.conf
systemctl status systemd-resolved --no-pager
sudo ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo systemctl restart systemd-resolved
Many Debian installs and most RHEL-family servers do not run systemd-resolved. There /etc/resolv.conf is a plain file written by NetworkManager or the DHCP client, and hand edits are overwritten. Change the source instead:
nmcli connection show
sudo nmcli connection modify "System eth0" ipv4.dns "9.9.9.9 149.112.112.112" ipv4.ignore-auto-dns yes
sudo nmcli connection up "System eth0"
systemd-resolved has no upstream servers
If resolvectl status lists no DNS servers for the main interface, the stub has nowhere to send queries. Test a fix for the current boot with sudo resolvectl dns eth0 9.9.9.9, then make it permanent in netplan. A separate file such as /etc/netplan/60-dns.yaml keeps your change apart from the file your provider generated:
network:
version: 2
ethernets:
eth0:
nameservers:
addresses:
- 9.9.9.9
- 149.112.112.112
Run sudo chmod 600 /etc/netplan/60-dns.yaml and sudo netplan try, and use the interface name that ip -br addr shows.
A DNS server on the same machine went quiet
Self-hosted resolvers and filters such as AdGuard Home, Pi-hole or Unbound need port 53, which the systemd-resolved stub already holds. The usual setup sets DNSStubListener=no in a file under /etc/systemd/resolved.conf.d/. If /etc/resolv.conf still points at the stub afterward, nothing answers on 127.0.0.53 and every lookup fails. The same happens when the local DNS service crashes. Check what listens with sudo ss -lunp 'sport = :53', then point /etc/resolv.conf at the address your DNS service really uses, or link it to /run/systemd/resolve/resolv.conf, which lists real upstream servers.
Outbound DNS is blocked
When ping 9.9.9.9 answers but dig @9.9.9.9 times out, a firewall drops DNS. Look at an outbound policy on the server itself, such as a UFW default deny outgoing set up without a rule for port 53 (see UFW in practice), at access lists in front of the server, and at office networks that force their own resolver. DNS uses UDP port 53 and falls back to TCP port 53 for large answers, so test both and allow both:
dig @9.9.9.9 example.com
dig @9.9.9.9 example.com +tcp
Validation failures that look like outages
A validating resolver returns a server failure when DNSSEC signatures do not check out, and the symptom matches an outage. Compare dig @9.9.9.9 example.com with the same query plus +cd, which asks the resolver to skip validation. If only the +cd query answers, either the domain's DNSSEC setup is broken, which its owner has to fix, or your clock is wrong. Signatures carry validity dates, so a server clock that is days off fails every check. timedatectl shows whether the clock is synchronized.
The server cannot resolve its own name
sudo looks up the machine's own host name and complains when neither /etc/hosts nor DNS knows it. Add the name that hostnamectl shows:
127.0.1.1 web-01.example.com web-01
If the file starts with a comment saying cloud-init manages it, change the template that comment names, or your edit disappears at the next boot.
Containers that cannot resolve
Test from a throwaway container with docker run --rm busybox nslookup example.com. Containers on the default bridge get a copy of the host's DNS settings. On user-defined networks, Docker's embedded resolver at 127.0.0.11 forwards queries to the host's servers. When the host resolves but containers do not, give Docker explicit servers in /etc/docker/daemon.json, then restart it with sudo systemctl restart docker:
{
"dns": ["9.9.9.9", "149.112.112.112"]
}
A restart of the daemon stops running containers unless live restore is enabled, so pick a quiet moment. A single container can also take --dns 9.9.9.9.
WSL on Windows
WSL writes /etc/resolv.conf itself. With DNS tunneling, the default on current Windows 11, the file points at 10.255.255.254 and Windows does the lookups, so a Windows VPN client can break resolution inside Linux. Run wsl --shutdown from PowerShell and try again. If the problem persists, set generateResolvConf=false under [network] in /etc/wsl.conf, replace the generated /etc/resolv.conf with your own nameserver lines, and restart WSL.
Make the next failure less likely
- Configure two resolvers run by different operators, so one outage is not yours.
- Never hand-edit a managed
/etc/resolv.conf. Change netplan, NetworkManager or systemd-resolved, whichever owns it. - Keep time synchronized with
systemd-timesyncdor chrony. - If you filter outbound traffic, write the DNS rules before switching the policy.
- Add a DNS check to your monitoring that resolves an outside name from the server itself.
FAQ
Why does ping 9.9.9.9 work but ping example.com fail?
Routing works and name resolution does not. Check the resolver configuration, then whether port 53 is blocked, then whether systemd-resolved is running.
Should I just write a nameserver line into /etc/resolv.conf?
Only when no service manages the file. On most servers something does, and it will overwrite your line at the next network change or reboot.
Which public DNS servers should I use?
Your provider's resolvers if it offers them, or well-known public services such as Quad9 (9.9.9.9, 149.112.112.112) or Cloudflare (1.1.1.1). Pick two from different operators.
Does this error mean the website is down?
No. It means your machine could not get an answer about the name. The site may be fine; check by asking a public resolver directly or by testing from another network.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




