company.com into the IP addresses that computers actually use to communicate. When DNS fails, websites and services become unreachable even though your underlying internet connection may be perfectly healthy. This guide walks you through diagnosing DNS problems and applying the correct fix for Windows, macOS, and Linux.
1
Identify DNS Failure Symptoms
Before making any changes, confirm that you are dealing with a DNS problem rather than a general connectivity issue. DNS failures have a distinctive signature.Classic symptoms of DNS failure:If Test 1 succeeds but Test 2 fails, you have a DNS resolution problem. Your internet connection is working correctly, but your device cannot translate domain names to IP addresses.
- Websites fail to load with errors such as
DNS_PROBE_FINISHED_NXDOMAIN,ERR_NAME_NOT_RESOLVED, orServer not found. - You can load websites by typing their IP address directly, but not by their domain name.
- Messaging apps or email clients that rely on domain names stop working, while locally resolved services remain accessible.
- The issue affects multiple different websites and services simultaneously.
If both tests fail, you likely have a broader connectivity issue rather than a pure DNS problem. Refer to the No Internet Connection guide first to restore basic connectivity before addressing DNS.
2
Flush the DNS Cache
Your operating system caches DNS responses locally to speed up repeat lookups. If an entry becomes stale or corrupted — for example, after a server changes its IP address — your device may continue routing traffic to the old, incorrect address. Flushing the cache forces a fresh lookup for every domain.Windows (Command Prompt or PowerShell — run as Administrator):Successful output:macOS Ventura / Sonoma (13+):macOS does not print a confirmation message on success. If the command completes without an error, the cache has been cleared.macOS Monterey (12) and earlier:Linux — systemd-resolved (Ubuntu 18.04+, Fedora, Arch):Linux — nscd (older distributions):Linux — dnsmasq:After flushing, open a browser and try loading a website. If it loads successfully, a stale cache entry was the cause and no further steps are needed.
3
Change Your DNS Server
If flushing the cache does not resolve the issue, your configured DNS server may be down, slow, or returning incorrect responses. Switching to a well-known public DNS resolver is a reliable fix.Recommended public DNS servers:
Windows:
macOS:
Linux (systemd-resolved):Edit the resolved configuration file:Find the Save the file and restart the service:
Windows:
- Press Win + R, type
ncpa.cpl, and press Enter. - Right-click your active network adapter and choose Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Choose Use the following DNS server addresses and enter your preferred values.
- Click OK, then close the windows.
macOS:
- Open System Settings → Network.
- Select your active interface (Wi-Fi or Ethernet) and click Details.
- Switch to the DNS tab.
- Click + to add
1.1.1.1and1.0.0.1, then click OK.
Linux (systemd-resolved):Edit the resolved configuration file:
[Resolve] section and update the DNS line:4
Test DNS Resolution with nslookup
nslookup is a cross-platform command-line tool that lets you query a DNS server directly and see exactly what it returns. It is available on Windows, macOS, and Linux without any installation.Basic hostname lookup:Interpreting nslookup error messages
Interpreting nslookup error messages
5
Check DNS Over a Firewall or VPN
Firewalls and VPN clients can block or redirect DNS traffic, causing resolution failures even when your DNS settings look correct.Verify that port 53 (DNS) is not blocked:A successful result looks like:If port 53 is blocked, work with your IT team to determine whether the firewall policy is intentional (e.g., forcing all DNS through a company resolver) or a misconfiguration.If you are on a VPN:
- Disconnect from the VPN and test DNS resolution again.
- If DNS works without the VPN but fails with it connected, the VPN is intercepting DNS queries. This is common with split-tunneling configurations that route DNS traffic incorrectly.
- Contact your VPN administrator or refer to the VPN Connectivity guide.
Some corporate environments use DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT) for encrypted DNS traffic. If your organization mandates this, standard port 53 tests will appear to fail even when DNS is working correctly through the encrypted channel.
6
Escalation Steps
If you have flushed the cache, switched DNS servers, and verified that port 53 is open, but DNS resolution still fails, escalate with the information below.
Information to collect before escalating
Information to collect before escalating
- Output of
nslookup google.comusing both your current DNS server and a public one (e.g.,nslookup google.com 8.8.8.8) - Output of
ipconfig /all(Windows) orcat /etc/resolv.conf(Linux) showing your currently configured DNS servers - Results of your ping tests — does
ping 8.8.8.8succeed whileping google.comfails? - Browser error messages — exact error codes such as
DNS_PROBE_FINISHED_BAD_CONFIGorERR_NAME_NOT_RESOLVED - Whether the issue affects all domains or only specific ones — a subset of failing domains may indicate a split-horizon DNS issue or a corrupted hosts file
- Contents of your hosts file (check for unexpected entries):