How to Fix DNS Not Resolving Errors

Fix DNS resolution failures by flushing your DNS cache, changing DNS servers to Cloudflare 1.1.1.1 or Google 8.8.8.8, and checking router DNS settings. Step-by-step for Windows, macOS, and Linux.

troubleshooting

DNS resolution errors prevent your devices from loading websites even when your internet connection is working. The DNS (Domain Name System) is what translates human-readable addresses like google.com into the IP addresses that routers and servers use to communicate. When DNS fails, your browser shows errors like “DNS_PROBE_FINISHED_NXDOMAIN,” “Server DNS address could not be found,” or simply “This site can’t be reached.”

The good news is that DNS problems are among the easiest network issues to diagnose and fix. Most can be resolved in under five minutes without any technical expertise.

Confirm the Problem Is DNS

Before changing any settings, verify that DNS is actually the issue and not a broader internet outage or Wi-Fi problem.

Test 1: Ping an IP address directly. Open Command Prompt (Windows) or Terminal (macOS/Linux) and type:

ping 8.8.8.8

If you get replies (e.g., “Reply from 8.8.8.8: bytes=32 time=15ms”), your internet connection works fine and the problem is DNS. If the ping fails with “Request timed out,” the issue is your internet connection, not DNS. See our fix no internet guide for that scenario.

Test 2: Try loading a website by IP address. Open your browser and type http://142.250.80.46 (a Google IP address). If the page loads, DNS is confirmed as the problem. If it does not load, the issue is connectivity, not DNS.

Test 3: Try a different DNS server manually. Open Command Prompt or Terminal and type:

nslookup google.com 1.1.1.1

This queries Cloudflare’s DNS server directly. If it returns an IP address, your default DNS server is the problem. If it also fails, the issue may be upstream from DNS.

Flush Your DNS Cache

Your device stores recently resolved DNS records in a local cache. If a cached record is corrupted, outdated, or incorrect, your device keeps trying to use the bad data instead of requesting a fresh lookup. Flushing the cache forces your device to query the DNS server again.

Windows:

  1. Press the Windows key, type cmd, and right-click Command Prompt. Select Run as administrator.
  2. Type the following command and press Enter:
    ipconfig /flushdns
  3. You should see: “Successfully flushed the DNS Resolver Cache.”
  4. Also reset the Winsock catalog and IP configuration:
    netsh winsock reset
    netsh int ip reset
  5. Restart your computer to apply the changes.

macOS:

  1. Open Terminal (Applications > Utilities > Terminal).
  2. Type the following command and press Enter (you will be prompted for your admin password):
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. No confirmation message appears on macOS, but the cache is flushed.

Linux (systemd-based):

  1. Open a terminal.
  2. Type:
    sudo systemd-resolve --flush-caches
  3. Verify with:
    sudo systemd-resolve --statistics
    The cache size should show 0.

Chrome browser (all platforms):

Chrome maintains its own DNS cache separate from the operating system. Clear it by:

  1. Open Chrome and type chrome://net-internals/#dns in the address bar.
  2. Click Clear host cache.
  3. Also go to chrome://net-internals/#sockets and click Flush socket pools.

After flushing the cache, try loading the website again. If it works, the problem was a corrupted cache entry and no further changes are needed.

Change Your DNS Server on a Single Device

If flushing the cache does not help, your DNS server itself may be down, slow, or misconfigured. Switching to a reliable public DNS server often fixes the problem instantly.

Recommended public DNS servers:

ProviderPrimarySecondaryNotes
Cloudflare1.1.1.11.0.0.1Fastest in independent tests
Google8.8.8.88.8.4.4Most widely used public DNS
Quad99.9.9.9149.112.112.112Blocks malware domains
OpenDNS208.67.222.222208.67.220.220Customizable filtering

Change DNS on Windows 10/11:

  1. Open Settings > Network & Internet > Wi-Fi (or Ethernet).
  2. Click your connected network.
  3. Under IP settings, click Edit.
  4. Change DNS from Automatic to Manual.
  5. Toggle IPv4 on.
  6. Enter 1.1.1.1 as Preferred DNS and 1.0.0.1 as Alternate DNS.
  7. Click Save.

Change DNS on macOS:

  1. Open System Settings > Wi-Fi.
  2. Click Details next to your connected network.
  3. Click DNS in the sidebar.
  4. Click the + button and add 1.1.1.1.
  5. Click + again and add 1.0.0.1.
  6. Remove any existing DNS entries by selecting them and clicking -.
  7. Click OK.

Change DNS on iPhone:

  1. Go to Settings > Wi-Fi.
  2. Tap the (i) next to your connected network.
  3. Tap Configure DNS.
  4. Select Manual.
  5. Delete existing DNS servers and add 1.1.1.1 and 1.0.0.1.
  6. Tap Save.

Change DNS on Android:

  1. Go to Settings > Network & Internet > Private DNS (Android 9+).
  2. Select Private DNS provider hostname.
  3. Enter one.one.one.one (Cloudflare) or dns.google (Google).
  4. Tap Save.

Test by loading several websites. If the problem is solved, you can either keep the device-level DNS change or apply the same change to your router to fix all devices at once.

Change DNS on Your Router

Changing DNS on your router applies the new DNS server to every device on your network automatically. This is the best long-term solution because you only configure it once.

  1. Log in to your router admin panel at 192.168.1.1 or your router’s address.
  2. Go to Internet Settings, WAN Settings, or Network > WAN.
  3. Find the DNS server fields. They may be labeled “DNS Address,” “DNS Server,” or “Domain Name Server.”
  4. Change the setting from Get Dynamically from ISP (or Automatic) to Manual (or Use These DNS Servers).
  5. Enter 1.1.1.1 as the Primary DNS.
  6. Enter 1.0.0.1 as the Secondary DNS.
  7. Click Save or Apply.
  8. Reboot the router for the change to take effect on all connected devices.

After the router reboots, all devices that use DHCP (automatic IP configuration, which is the default) will receive the new DNS settings. Devices with manually configured DNS settings will continue using their own DNS and are not affected by the router change.

Check for Other DNS Issues

If flushing the cache and changing the DNS server do not fix the problem, deeper issues may be at play:

Malware or adware altering DNS settings. Some malware changes your device’s DNS settings to redirect you to malicious servers. Check that your DNS settings have not been changed to unfamiliar addresses. Run a malware scan with Windows Defender, Malwarebytes, or your preferred security software.

Router DNS hijacking. If your router has been compromised, its DNS settings may have been changed by an attacker. Log in to your router and verify the DNS settings match what you configured. If they have been changed and you did not do it, perform a factory reset on your router, update the firmware, and change the admin password.

ISP DNS outage. If you were using your ISP’s default DNS and it went down, switching to Cloudflare or Google DNS (as described above) bypasses the outage entirely.

Browser-specific DNS cache. If DNS works everywhere except one browser, clear that browser’s cache and DNS. In Chrome: chrome://net-internals/#dns > Clear host cache. In Firefox: about:networking#dns > Clear DNS Cache.

Hosts file entries. Your device’s hosts file can override DNS for specific domains. On Windows, check C:\Windows\System32\drivers\etc\hosts. On macOS/Linux, check /etc/hosts. If you see entries for the domain that is not resolving, the hosts file is the cause.

IPv6 DNS issues. Some networks have IPv6 enabled but poorly configured. If IPv4 DNS works but IPv6 does not, you may experience intermittent failures as your device alternates between the two. Disable IPv6 temporarily in your network adapter settings to test. If this fixes the issue, configure IPv6 DNS addresses alongside IPv4 or disable IPv6 on your router.

Prevent DNS Issues from Recurring

Once you have resolved the immediate problem, take steps to prevent future DNS failures:

  1. Use a reliable public DNS permanently. Switch your router DNS to Cloudflare or Google to avoid dependency on your ISP’s DNS infrastructure.
  2. Keep your router firmware updated. Firmware bugs can cause DNS forwarding failures. Check for updates regularly through your router admin panel. See our firmware update guide for instructions.
  3. Restart your router periodically. A monthly reboot clears the router’s DNS cache and resolves memory leaks that accumulate over time.
  4. Monitor for DNS changes. Periodically log in to your router and verify the DNS settings have not been altered. Unexpected DNS changes can indicate a security breach.

Frequently Asked Questions

What does DNS not resolving mean?

DNS (Domain Name System) translates website names like google.com into IP addresses like 142.250.80.46. When DNS is not resolving, your device cannot perform this translation. You can connect to Wi-Fi but websites will not load. You may see errors like 'DNS_PROBE_FINISHED_NXDOMAIN' or 'Server DNS address could not be found.'

Why can I connect to Wi-Fi but websites will not load?

This usually means your internet connection is working but DNS resolution is failing. Your device reaches the router, and the router reaches the ISP, but the DNS server is not responding. Try typing 8.8.8.8 in your browser. If Google loads by IP but not by name, DNS is the confirmed problem.

How do I flush my DNS cache?

On Windows, open Command Prompt as administrator and type 'ipconfig /flushdns'. On macOS, open Terminal and type 'sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder'. On Linux, type 'sudo systemd-resolve --flush-caches'. On Chrome browser, visit chrome://net-internals/#dns and click Clear host cache.

What DNS server should I use?

Cloudflare 1.1.1.1 is the fastest public DNS in most speed tests. Google 8.8.8.8 is reliable and well-established. Quad9 9.9.9.9 includes built-in malware domain blocking. Any of these are better than most ISP default DNS servers for both speed and reliability.

Should I change DNS on my device or my router?

Changing DNS on your router applies the change to every device on your network automatically. Changing DNS on a single device affects only that device. Start by changing it on one device to test. If the new DNS works, apply the same change on your router so all devices benefit.