How to Flush DNS Cache and Fix 'DNS Server Not Responding' Errors on All Platforms
This guide provides comprehensive, platform-specific instructions for flushing your local DNS cache across Windows, macOS, and Linux. This resolves common connectivity issues like 'DNS Server Not Responding' by forcing your system to refresh its network address records.
Direct Diagnostic & Remediation Summary
- Windows: Open Command Prompt as Admin and run
ipconfig /flushdns. - macOS: Open Terminal and run
sudo dscacheutil -flushcache; sudo killall -H processes. - Linux (Systemd): Run
sudo systemd-resolve --flush-caches(or equivalent for your distro).
Understanding DNS and Initial Triage
Before flushing anything, it is vital to understand what DNS is. The Domain Name System (DNS) acts like the internet's phonebook; it translates human-readable domain names (like www.google.com) into machine-readable IP addresses (like 142.250.191.78). When you see 'DNS Server Not Responding,' your local machine might be holding onto an outdated or incorrect record, or a temporary issue with the configured DNS server itself.
Initial Checks:
- Check physical connections (Ethernet cables securely plugged in).
- Try accessing IP addresses directly (e.g., ping 8.8.8.8) instead of domain names to isolate if the issue is name resolution or general connectivity.
If basic pings work but websites do not load, flushing the cache is the next logical step.
Platform-Specific Cache Flushing Procedures
The command to flush the cache differs significantly between operating systems. Follow the instructions for your specific OS carefully.
Windows (Command Prompt/PowerShell)
- Search for
cmdorpowershellin the Start Menu. - Right-click on the result and select Run as administrator.
- Execute the following command:
ipconfig /flushdns - You should receive a confirmation message stating that the DNS Resolver Cache was successfully flushed.
macOS (Terminal)
Use the Terminal application found in Utilities.
- Open Terminal.
- Execute the cache flushing command (Note: Modern macOS versions use multiple commands for thorough cleaning):
sudo dscacheutil -flushcache; sudo killall -H processes - You will be prompted for your user password. Type it in (it will not display any characters) and press Enter.
- The process runs silently upon successful execution.
Linux (Terminal)
The command depends heavily on the networking service manager used (e.g., systemd-resolved, nscd). For modern systems using systemd:
- Open Terminal.
- Execute:
sudo systemd-resolve --flush-caches
If the above fails, try restarting the local resolver service (requires root access):
sudo systemctl restart systemd-resolvedAdvanced Troubleshooting: Router and DNS Server Reset
If the cache flush did not resolve the issue, the problem is likely upstream. This step involves refreshing the connection path.
- Renew IP Lease (All Platforms): Force your device to request a new set of network parameters from the DHCP server.
ipconfig /releaseipconfig /renew - Router Power Cycle (Crucial Step): Unplug your Wi-Fi router and modem from power. Wait a full 60 seconds. Plug the modem in first, wait until its lights stabilize. Then, plug the router back in and wait for it to fully boot up. This forces the router to pull fresh DNS information from your ISP.
Verification, Results & Preventative Maintenance
After completing the flush and rebooting equipment, you must verify that name resolution is functioning correctly.
- Test 1 (Name Resolution): Try accessing several diverse websites (e.g., google.com, microsoft.com). If they load quickly, the cache flush was successful.
- Test 2 (DNS Lookup Verification): Use the
nslookupcommand to query a known site directly:nslookup example.comA successful output will list multiple IP addresses associated with that domain name, confirming your local machine can resolve names correctly.
- Preventative Maintenance: To minimize future DNS issues, make it a habit to power cycle your router/modem every few months. Furthermore, consider setting up automatic updates for your operating system, as these often include network stack improvements.
ipconfig /flushdns
ipconfig /release
ipconfig /renew
sudo dscacheutil -flushcache; sudo killall -H processes
sudo systemd-resolve --flush-caches
Frequently Asked Questions
Why did I need to reboot my router after flushing the DNS cache?
Flushing only clears your device's memory. Rebooting the router forces it to request fresh network configurations and DNS records from your ISP, clearing any stale information held at the gateway level.
Is running these commands dangerous?
No, these are standard diagnostic tools. They only clear temporary address records (cache) and do not delete any actual user files or settings on your computer.
What if I don't know which DNS server to use?
For general home use, sticking with the automatic DHCP provided by your router is usually best. If troubleshooting fails, temporarily setting 1.1.1.1 (Cloudflare) is a reliable fallback test.
Need help implementing this solution?
Our cybersecurity and infrastructure engineers can audit, harden, or configure your systems directly.
Community Discussion & Confirmations (0)
Technical questions, hardware findings, and verified fix reports.
No reader questions posted yet. Have you tried this solution or experienced an edge case? Post below.