Fix the Ubuntu resolver error

"Temporary failure in name resolution" - the glibc resolver message that ping, ssh and other tools print when no DNS server answered (EAI_AGAIN)

Affects: Ubuntu (desktop and server, all releases with the glibc resolver)

What this message means

This is the message glibc's resolver hands to programs when a hostname lookup completes without an answer. The source of the wording is the getaddrinfo man page, which documents the underlying code: "EAI_AGAIN The name server returned a temporary failure indication. Try again later." [1]. glibc's own text for that code is "Temporary failure in name resolution", which is what ping and ssh print [3].

For a Smart DNS setup the usual reading is: your machine asked the resolver you configured (or the one the network handed out) and got silence. That can be a wrong address in the connection settings, an unreachable resolver, or the resolver service itself not running. The message does not distinguish these, so the fixes below run from most likely to least.

Fix it step by step

Cause 1: The name servers in the connection settings are wrong or were never applied

The most likely cause right after a Smart DNS change: a transposed digit, or the change was never committed because the connection was not reconnected.

Fix:

  1. Open Settings > Network > (gear icon) > IPv4 and check the DNS field against your provider's addresses exactly.
  2. Correct or re-enter them, click Apply, then disconnect and reconnect to the network.
  3. Confirm on the provider's status page that your IP is registered - an unregistered IP can produce the same silence for the streaming hostnames.

Step 7 of How to change DNS on Ubuntu covers the Apply and reconnect step.

Cause 2: A hand-edited /etc/resolv.conf broke the resolver

If someone replaced /etc/resolv.conf with a hand-written file, Ubuntu's resolver architecture can end up with no reachable server. On Ubuntu Desktop the file is a symlink that systemd-resolved regenerates, and the project documentation states that the stub file "should not be used directly by applications, but only through a symlink from /etc/resolv.conf" [4].

Fix:

  1. Check what the file is: ls -l /etc/resolv.conf. A symlink into /run/systemd/resolve/ is the healthy state.
  2. If it is a plain file with wrong entries, restore the symlink per Ubuntu's documentation, or set your DNS on the connection instead of the file.
  3. Restart the resolver service after repairs: sudo systemctl restart systemd-resolved.

Cause 3: The network is up but the resolver is unreachable

If raw IP traffic works but lookups do not, the resolver path is broken: a firewall blocking DNS, an ISP resolver outage, or the provider's servers being unreachable from your network.

Fix:

  1. Test connectivity to a raw IP: ping -c 2 1.1.1.1. If that fails, the problem is the network, not DNS.
  2. Query a known resolver directly: dig example.com @1.1.1.1 (or your provider's address). If the direct query works but the system-wide one does not, the configured resolver is the problem.
  3. Re-check the error page for the message type: if the lookup now returns an answer for some names but others give the negative variant, read fix Name or service not known instead.

If nothing helps

Switch the connection's DNS back to Automatic, reconnect, and confirm normal lookups work with the network's own resolvers. If they do, the provider's addresses are the problem - copy them fresh from the dashboard rather than retyping. If automatic DNS also fails with the same message, the failure is in the resolver service or the network path, not in your choice of resolver; restart systemd-resolved once and check the IPv6 situation on dual-stack networks, since IPv6-first lookups can fail independently of IPv4. The DNS switch in the setup guide documents both tabs.

FAQ

Is this error the same as "Name or service not known"?

No. This message means the resolver got no answer at all, while "Name or service not known" is an authoritative negative answer [1]. The distinction matters because this one points at the resolver or its reachability.

Why does the error say "temporary" if it does not go away?

The word comes from the man page's advice to try again later [1]. Until the resolver configuration or reachability is fixed, every retry fails the same way.

Does the error appear only in the terminal?

The exact string appears in command-line tools; graphical apps typically just fail to load. apt reports the same failure with its own wording, so both surfaces point at the same resolver.

Setting up DNS on this device?

Open the setup guide → All Ubuntu guides

Sources

  1. Linux man pages - getaddrinfo(3) - accessed 2026-11-23
  2. phoenixNAP - How to Resolve the "Temporary failure in name resolution" Error - accessed 2026-11-23
  3. Apisylux - Temporary Failure in Name Resolution on Ubuntu - accessed 2026-11-23