User Agents

Web browsers and everyday web tech, explained

DNS Hard Error Looking Up: What It Means and How to Fix

· 5 min read · How the Web Works

In this article
  1. Fix a DNS Hard Error in 6 Steps
  2. Which Kind of DNS Failure You Have
  3. Each Cause and Its Fix
  4. What to Do When the Error Keeps Coming Back

A "DNS hard error looking up" almost always means your device could not resolve a hostname into an IP address, and the lookup failed permanently rather than timing out. The most common fix is to switch to a public DNS resolver such as Google DNS (8.8.8.8) or Cloudflare (1.1.1.1) in your network settings.

Time 15 min · Steps 6 · Level Easy

Fix a DNS Hard Error in 6 Steps

  1. Confirm it is DNS. Open a browser and go to a site by its IP address (for example, 1.1.1.1). If that loads but normal site names fail, the problem is DNS resolution, not your connection.
  2. Restart the router. Unplug the router's power for 30 seconds, plug it back in, and wait about 2 minutes for it to reconnect. This clears cached DNS failures in the router itself.
  3. Flush the local DNS cache. On Windows, open Command Prompt and run ipconfig /flushdns. On macOS, open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Linux, run sudo systemd-resolve --flush-caches or restart the resolver service, depending on your distribution.
  4. Change your DNS servers. In your device's network settings, replace the automatic DNS with 8.8.8.8 and 8.8.4.4 (Google) or 1.1.1.1 and 1.0.0.1 (Cloudflare). Set it on the router if you want every device in the house to use it.
  5. Test resolution. In a terminal, run nslookup example.com 8.8.8.8. If that returns an address but nslookup example.com without the server fails, your configured DNS server is the problem.
  6. Check hosts and security software. Look at the hosts file (Windows: C:\Windows\System32\drivers\etc\hosts; macOS and Linux: /etc/hosts) for stale entries, and temporarily disable VPN or security software to see whether it is intercepting DNS.

Which Kind of DNS Failure You Have

Tell the three failure types apart before you fix anything, because the fixes differ. A hard error returns immediately with a message like "name or service not known" or "DNS hard error looking up" — the resolver answered with a firm "no such name." A timeout takes several seconds and then says the server did not respond, which points to a dead or unreachable DNS server. A partial failure affects only some sites, which usually means a stale cache or a hosts-file entry.

Run one command to sort it out. In a terminal, use nslookup sitename (Windows) or dig sitename (macOS and Linux). If the reply comes back in under a second with "NXDOMAIN" or "no answer," it is a hard error. If it hangs for several seconds and then times out, it is a connectivity problem with your DNS server. If it resolves but the browser still fails, clear the browser's own cache and cookies for that site.

Each Cause and Its Fix

The hostname genuinely does not exist

How to confirm: nslookup against 8.8.8.8 also returns NXDOMAIN, and the site fails on another network, such as mobile data. Fix: check the spelling of the address, including the top-level domain. If an internal work address fails, the name may only resolve on your company network or VPN — connect to the VPN and try again.

Your configured DNS server is broken or filtered

How to confirm: nslookup example.com 8.8.8.8 works, but the same lookup with your default server fails. Fix: switch to a public resolver as in step 4. Some internet providers block or redirect third-party DNS; if lookups still fail after switching, test from a different network to rule that out.

Stale cache on your device or router

How to confirm: the site fails on this device but loads fine on your phone using mobile data. Fix: flush the DNS cache as in step 3, then restart the router. On Windows you can also release and renew the network lease with ipconfig /release followed by ipconfig /renew, which fetches fresh DNS settings from the router.

VPN, proxy or security software intercepting DNS

How to confirm: the error appears only while the VPN or filter is on. Fix: disconnect the VPN and retry; if that fixes it, update or reinstall the VPN software, or set its DNS to a public resolver in its own settings. In a browser, also check that no manual proxy is set: on Windows look under Settings > Network & Internet > Proxy; on macOS under System Settings > Network, then your connection's proxy options. Exact labels can differ slightly by version.

IPv6 misconfiguration

How to confirm: the error mentions an IPv6 address (starting with "fe80" or similar), or lookups work only when IPv6 is disabled. Fix: in your network adapter settings, set IPv6 to automatic, or temporarily disable IPv6 on the adapter to test. If the router hands out broken IPv6 DNS servers, set DNS manually on the router instead.

What to Do When the Error Keeps Coming Back

If the fix works but the error returns after a few hours or days, the router is likely losing its DNS settings each time it reboots or renews its connection. Log in to the router's admin page (usually reached by typing 192.168.1.1 or 192.168.0.1 into a browser; the address is printed on the router's label) and set the DNS servers there so every device inherits them. Write down the two addresses you set so you can check them later.

If only one device keeps failing while others on the same network are fine, reset that device's network settings entirely: on Windows, Settings > Network & Internet > Advanced network settings > Network reset; on Android, Settings > System > Reset options; on iPhone, Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings. Menu names can differ slightly by version. You will need to re-enter Wi-Fi passwords afterwards, so have them ready.

If every device fails and changing DNS on the router does not help, the fault is with the internet connection itself rather than DNS. Contact your provider at that point, and mention that DNS resolution fails even when you use public resolvers.

Official source: Google Android Help