If you see “temporary failure in name resolution” on Linux or macOS, it means your system cannot reach a DNS server to translate a domain name into an IP address. The fix is usually to check your network connection, restart the DNS resolver, or edit your DNS settings in /etc/resolv.conf or your router. This article walks you through the most common causes and step-by-step solutions.
What “Name Resolution” Means
Every time you visit a website or connect to a server, your computer needs to convert a human-readable name like example.com into a numeric IP address like 93.184.216.34. This translation is called name resolution, and it is handled by the Domain Name System (DNS). When your system says “temporary failure in name resolution,” it means the DNS lookup failed, not that the website is necessarily down.
This error is most common on Linux and macOS systems, but Windows users may see a similar message like “DNS_PROBE_FINISHED_NXDOMAIN” or “The response to the DNS query was not received.” The underlying issue is the same: your device cannot get an answer from a DNS server.
Common Causes
- Network connection down: Wi-Fi disconnected, Ethernet cable unplugged, or VPN dropped.
- DNS server unreachable: Your configured DNS server is down, blocked, or unreachable due to firewall rules.
- Misconfigured
/etc/resolv.conf: The file that tells your system which DNS servers to use may be empty, contain a bad IP, or point to a server that no longer exists. - Systemd-resolved or dnsmasq issues: Many Linux distributions use a local DNS resolver that can get stuck or misbehave.
- DHCP lease renewal failure: Your router may have failed to assign a valid DNS server address.
- Firewall or security software: Sometimes a firewall blocks outgoing DNS requests (port 53).
How DNS Resolution Works (Briefly)
When you type a URL, your system first checks its local cache. If the name is not cached, it sends a query to the DNS server listed in /etc/resolv.conf (on Linux/macOS) or in your network adapter settings (on Windows). That server may answer from its own cache or query other servers up the chain. The “temporary failure” message appears when your system cannot get any answer from the configured DNS server within a timeout period.
Often the problem is not the DNS server itself but the connection to it. For instance, if you are on a VPN, the VPN may not be routing DNS queries correctly. Or if your router is offline, your device may have a stale IP address and no route to the DNS server.
Step-by-Step Fixes
Try these in order. Stop when the problem is resolved.
- Check your network connection. Run
ping 8.8.8.8(orping 1.1.1.1). If you get replies, you have a network connection. If not, reconnect to Wi-Fi, plug in the cable, or restart your router. - Check if DNS works at all. Run
ping example.com. If that fails butping 8.8.8.8works, the issue is DNS-specific. - Restart the DNS resolver. On most Linux systems with systemd, run
sudo systemctl restart systemd-resolved. On older systems using dnsmasq, runsudo systemctl restart dnsmasq. On macOS, you can flush the DNS cache withsudo dscacheutil -flushcacheandsudo killall -HUP mDNSResponder. - Check
/etc/resolv.conf. Open it withcat /etc/resolv.conf. It should contain at least onenameserverline. If it is empty or contains a localhost address like 127.0.0.53, that is normal for systemd-resolved, but if the local resolver is down, you can temporarily add a public DNS server likenameserver 8.8.8.8and test again. - Renew your DHCP lease. On Linux, run
sudo dhclient -rand thensudo dhclient(or use your network manager). On macOS, turn Wi-Fi off and on again. - Check firewall rules. If you use a firewall like
ufw, ensure outgoing DNS (port 53) is allowed. You can temporarily disable the firewall withsudo ufw disableto test, then re-enable it. - Restart your computer. This clears temporary network state and often fixes the issue if nothing else works.
When to Use a Public DNS Server
If your ISP’s DNS server is unreliable, you can switch to a public DNS server. Common ones include Google Public DNS (8.8.8.8 and 8.8.4.4), Cloudflare (1.1.1.1 and 1.0.0.1), and Quad9 (9.9.9.9). To change your DNS settings permanently:
- On a router: Log into your router’s admin page, find the DNS settings, and replace the ISP-provided addresses with public ones.
- On Linux (NetworkManager): Edit your connection settings via the GUI or use
nmclito set DNS servers. - On macOS: Go to System Settings > Network, select your connection, click Details, and add DNS servers.
- On Windows: Go to Network Settings > Change adapter options, right-click your adapter, select Properties, then IPv4 properties, and enter DNS addresses.
Note that using a public DNS server can sometimes be slower than your ISP’s, but it is often more reliable. It also bypasses any DNS-level blocking your ISP might implement.
Common Related Misconceptions
One common misconception is that this error means your internet is completely down. In reality, you might have a working connection but simply cannot resolve domain names. Another is that clearing your browser cache fixes it; the browser cache is separate from the system DNS cache. The error message “temporary failure” suggests the issue might be transient, but it can persist if the root cause is not fixed.
Another misconception is that you must edit /etc/resolv.conf directly. On many modern Linux distributions, that file is managed by systemd-resolved or NetworkManager, and manual edits are overwritten on reboot. Use the proper tools for your distribution instead.
Frequently Asked Questions
Why do I get “temporary failure in name resolution” on one device but not others?
This usually means the problem is specific to that device’s network settings, not your internet connection. Check the device’s DNS settings, its connection, and whether it has a VPN or proxy enabled.
Can a VPN cause this error?
Yes. VPNs often route DNS queries through their own servers. If the VPN connection is unstable or the VPN server’s DNS is misconfigured, you can see this error. Try disconnecting the VPN and testing again.
What does “temporary failure” actually mean?
It means the DNS lookup failed at the time of the request, but the failure may not be permanent. It could be a timeout, a server outage, or a temporary network issue. The system does not know if it will work later, hence “temporary.”
Is it safe to use public DNS servers like 8.8.8.8?
Yes, public DNS servers are generally safe and widely used. They are run by large companies and are subject to privacy policies. However, they do see your DNS queries, so if privacy is a concern, consider a DNS service that emphasizes privacy, like Quad9 or Cloudflare.
How do I flush the DNS cache on Linux?
It depends on your system. If you use systemd-resolved, run sudo systemd-resolve --flush-caches. On older systems, you may need to restart the nscd service or use sudo /etc/init.d/dns-clean restart. On macOS, use sudo dscacheutil -flushcache.
Will changing my DNS server fix the error permanently?
If the error is caused by an unreliable DNS server, yes. But if the cause is a network issue, a VPN, or a firewall, changing DNS may not help. It is best to diagnose the root cause first.
Preventing Future Issues
To minimize the chance of this error recurring, keep your system and router firmware updated, use reliable DNS servers, and avoid manually editing /etc/resolv.conf if you are not sure what you are doing. If you use a VPN, make sure it is up to date and configured correctly. Also, consider setting a fallback DNS server in your network settings so that if the primary fails, the secondary can take over.
If the problem persists after trying all the steps above, it may be a deeper network issue, such as a misconfigured router or a problem with your ISP. In that case, contact your internet service provider or a network administrator for assistance.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It