DNS (Domain Name System) resolution issues are among the most common networking problems that can disrupt your work, prevent access to websites, and cause application failures. When DNS fails, you might see error messages like “DNS_PROBE_FINISHED_NXDOMAIN” or “Server DNS address could not be found.” This guide will walk you through systematic troubleshooting steps to diagnose and fix DNS resolution problems.
Understanding DNS Resolution
Before diving into troubleshooting, it’s important to understand how DNS works. When you type a domain name like “example.com” into your browser, your computer performs several steps:
- Check Local Cache: Your system first checks if it has recently resolved this domain
- Query DNS Resolver: If not cached, it queries your configured DNS server
- Recursive Lookup: The DNS server performs recursive queries through the DNS hierarchy
- Return IP Address: The resolved IP address is returned and cached for future use
Step 1: Verify Internet Connectivity
Before assuming it’s a DNS issue, confirm your internet connection is working:
# Test connectivity with IP address (bypasses DNS)
ping 8.8.8.8
## If this works but domain names don't, it's likely a DNS issue
ping google.com
If pinging the IP address works but the domain name fails, you’ve confirmed a DNS problem.
Step 2: Flush DNS Cache
Corrupted or outdated DNS cache entries are a common cause of resolution failures.
Windows
## Open Command Prompt as Administrator
ipconfig /flushdns
macOS
## Different commands for different macOS versions
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Linux
## For systemd-resolved (Ubuntu 18.04+)
sudo systemd-resolve --flush-caches
## For nscd
sudo /etc/init.d/nscd restart
## For dnsmasq
sudo /etc/init.d/dnsmasq restart
Step 3: Check DNS Server Configuration
Incorrect DNS server settings are a frequent culprit.
View Current DNS Settings
Windows:
ipconfig /all
Linux/macOS:
cat /etc/resolv.conf
Common Public DNS Servers
If your current DNS servers aren’t working, try switching to reliable public DNS servers:
- Google DNS:
8.8.8.8and8.8.4.4 - Cloudflare DNS:
1.1.1.1and1.0.0.1 - Quad9 DNS:
9.9.9.9and149.112.112.112
Change DNS Settings
Windows:
- Open Network Connections (Control Panel → Network and Internet → Network Connections)
- Right-click your active connection and select Properties
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties
- Select “Use the following DNS server addresses”
- Enter preferred DNS servers
Linux (using NetworkManager):
## Edit the connection
nmcli connection modify "Your-Connection-Name" ipv4.dns "8.8.8.8 8.8.4.4"
nmcli connection down "Your-Connection-Name"
nmcli connection up "Your-Connection-Name"
macOS:
- Open System Preferences → Network
- Select your active connection and click Advanced
- Go to DNS tab
- Add DNS servers using the + button
Step 4: Test DNS Resolution
Use diagnostic tools to test DNS resolution and identify where failures occur.
Using nslookup
## Test resolution with default DNS server
nslookup example.com
## Test with specific DNS server
nslookup example.com 8.8.8.8
Using dig (Linux/macOS)
## Detailed DNS query information
dig example.com
## Query specific DNS server
dig @8.8.8.8 example.com
## Trace the full resolution path
dig +trace example.com
Using host
## Simple DNS lookup
host example.com
## Query specific DNS server
host example.com 8.8.8.8
Step 5: Check Hosts File
The hosts file can override DNS lookups. Incorrect entries here can cause resolution issues.
Hosts File Locations
- Windows:
C:\Windows\System32\drivers\etc\hosts - Linux/macOS:
/etc/hosts
Check for Problematic Entries
## Linux/macOS
cat /etc/hosts | grep -v "^#" | grep -v "^$"
## Look for entries that might be blocking domains
Remove or comment out (add # at the beginning) any suspicious entries that might be interfering with DNS resolution.
Step 6: Restart Network Services
Sometimes network services need to be restarted to apply changes.
Windows
## Restart network adapter
ipconfig /release
ipconfig /renew
## Restart DNS Client service
net stop dnscache
net start dnscache
Linux
## For NetworkManager
sudo systemctl restart NetworkManager
## For systemd-networkd
sudo systemctl restart systemd-networkd
sudo systemctl restart systemd-resolved
macOS
## Restart mDNSResponder
sudo killall -HUP mDNSResponder
Step 7: Check Firewall and Security Software
Firewalls or security software might be blocking DNS queries.
Temporarily Disable to Test
Important: Only disable temporarily for testing, and re-enable immediately after.
- Check if port 53 (DNS) is blocked
- Look for DNS filtering features in security software
- Review firewall logs for blocked DNS traffic
Configure Firewall Rules
If DNS is blocked, add rules to allow:
- Outbound UDP on port 53
- Outbound TCP on port 53 (for larger queries)
Step 8: Router and Modem Issues
DNS problems can originate from your router or modem.
Restart Your Router
- Power off your router and modem
- Wait 30 seconds
- Power on the modem first, wait for it to fully boot
- Power on the router
- Wait for full connection establishment
Check Router DNS Settings
Log into your router’s admin panel (typically 192.168.1.1 or 192.168.0.1) and:
- Verify DNS servers configured in WAN settings
- Check if DNS relay is enabled
- Look for any DNS filtering or parental control features
- Update router firmware if outdated
Step 9: ISP DNS Server Issues
Your ISP’s DNS servers might be experiencing problems.
Test ISP DNS Servers
## Find your ISP's DNS servers
ipconfig /all # Windows
cat /etc/resolv.conf # Linux/macOS
## Test them specifically
nslookup google.com <ISP_DNS_IP>
If ISP DNS servers are unresponsive, switch to public DNS servers (see Step 3).
Step 10: Advanced Troubleshooting
For persistent issues, try these advanced techniques:
Check DNS over HTTPS (DoH)
Some browsers use DNS over HTTPS, which can cause conflicts:
- Firefox: Settings → General → Network Settings → Enable DNS over HTTPS
- Chrome: Settings → Privacy and security → Security → Use secure DNS
Try disabling DoH to see if it resolves the issue.
Reset TCP/IP Stack
Windows:
netsh winsock reset
netsh int ip reset
## Restart computer
Linux:
sudo ip addr flush dev eth0 # Replace eth0 with your interface
sudo systemctl restart NetworkManager
Check for DNS Hijacking
## Query multiple DNS servers for the same domain
dig @8.8.8.8 google.com
dig @1.1.1.1 google.com
## Results should match; if not, investigation needed
Prevention and Best Practices
Once you’ve resolved your DNS issues, follow these practices to prevent future problems:
1. Use Multiple DNS Servers
Configure both primary and secondary DNS servers for redundancy:
Primary: 8.8.8.8
Secondary: 1.1.1.1
2. Regular Cache Clearing
Periodically flush your DNS cache, especially after network changes or when experiencing slowdowns.
3. Monitor DNS Performance
Use tools to monitor DNS resolution times:
## Linux/macOS
time dig example.com
Consistently slow responses (>100ms) might indicate DNS server issues.
4. Document Your Configuration
Keep a record of:
- Current DNS servers in use
- Custom hosts file entries
- Network configuration settings
5. Keep Systems Updated
Regularly update:
- Operating system
- Router firmware
- Security software
- Network drivers
Troubleshooting by Operating System
Windows-Specific Issues
Error: “DNS server not responding”
- Run Windows Network Diagnostics: Settings → Network & Internet → Status → Network troubleshooter
- Check Windows Firewall isn’t blocking DNS
Registry Issues:
## Reset Winsock
netsh winsock reset catalog
Linux-Specific Issues
systemd-resolved conflicts:
## Check status
systemctl status systemd-resolved
## View current DNS settings
resolvectl status
NetworkManager vs systemd-resolved: Ensure they’re not conflicting. Choose one DNS management method.
macOS-Specific Issues
mDNSResponder problems:
## Check logs
sudo log show --predicate 'process == "mDNSResponder"' --last 1h
## Restart with verbose logging
sudo killall -USR1 mDNSResponder
Common DNS Error Messages and Solutions
| Error Message | Likely Cause | Solution |
|---|---|---|
| DNS_PROBE_FINISHED_NXDOMAIN | Domain doesn’t exist or DNS can’t resolve | Check domain spelling, flush DNS cache |
| DNS_PROBE_FINISHED_NO_INTERNET | No internet connection | Check physical connection, restart router |
| DNS_PROBE_FINISHED_BAD_CONFIG | DNS configuration error | Verify DNS server settings |
| Server DNS address could not be found | DNS server unreachable | Change to public DNS servers |
When to Contact Your ISP
Contact your Internet Service Provider if:
- Public DNS servers work but ISP DNS servers don’t
- Multiple devices on your network have the same issue
- Problems persist after trying all troubleshooting steps
- DNS issues coincide with other network problems
Related Articles
- Cloudflare DDoS Protection. How is it so good AND free?
- Understanding and Implementing Linux Network Namespaces
- Stealth Nmap for Modern Network Analysis
- How to Debug Slow Network Performance: A Step-by-Step Guide
Conclusion
DNS resolution issues can be frustrating, but they’re usually solvable with systematic troubleshooting. Start with simple solutions like flushing your cache and checking connectivity, then progress to more advanced steps if needed. Remember to:
- Verify it’s actually a DNS issue (not general connectivity)
- Try public DNS servers like Google DNS or Cloudflare
- Clear your DNS cache and restart network services
- Check for configuration errors in hosts file or network settings
- Rule out firewall, router, and ISP issues
By following this guide, you should be able to diagnose and fix most DNS resolution problems. Keep this guide handy for future reference, and consider bookmarking reliable troubleshooting commands for quick access.
Pro tip: Create a simple script with your most-used diagnostic commands so you can quickly run through checks when issues arise. This will save you time and help identify problems faster in the future.