WiFi & Networking BEGINNER All Platforms โฑ๏ธ 4 min read ๐Ÿ“… Updated: 13 Sep 2026

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.

Gurveer Singh
Gurveer Singh โœ“ Verified Specialist
Founder & Chief Architect ยท hSECURITIES Labs
โšก FAST-TRACK PROTOCOL

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).
๐Ÿ› ๏ธ Tools & Prerequisites: Administrative privileges on the affected machine (Windows, macOS, or Linux). Access to the Command Line Interface (CLI) or Terminal.
STEP 1

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.

Warning: Flushing DNS only clears your local device's temporary records. If the problem persists after this guide, the issue likely lies with your router or ISP's DNS servers.
STEP 2

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)

  1. Search for cmd or powershell in the Start Menu.
  2. Right-click on the result and select Run as administrator.
  3. Execute the following command:
    ipconfig /flushdns
  4. You should receive a confirmation message stating that the DNS Resolver Cache was successfully flushed.

macOS (Terminal)

Use the Terminal application found in Utilities.

  1. Open Terminal.
  2. Execute the cache flushing command (Note: Modern macOS versions use multiple commands for thorough cleaning):
    sudo dscacheutil -flushcache; sudo killall -H processes
  3. You will be prompted for your user password. Type it in (it will not display any characters) and press Enter.
  4. 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:

  1. Open Terminal.
  2. Execute:
    sudo systemd-resolve --flush-caches

If the above fails, try restarting the local resolver service (requires root access):

sudo systemctl restart systemd-resolved

STEP 3

Advanced 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 /release
    ipconfig /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.
Pro Tip: If you suspect your ISP's assigned DNS servers are faulty, manually configure a reliable public DNS resolver (like Google's 8.8.8.8 or Cloudflare's 1.1.1.1) on your router settings interface instead of relying on DHCP assignment.
FINAL STEP

Verification, Results & Preventative Maintenance

After completing the flush and rebooting equipment, you must verify that name resolution is functioning correctly.

  1. Test 1 (Name Resolution): Try accessing several diverse websites (e.g., google.com, microsoft.com). If they load quickly, the cache flush was successful.
  2. Test 2 (DNS Lookup Verification): Use the nslookup command to query a known site directly:
    nslookup example.com

    A successful output will list multiple IP addresses associated with that domain name, confirming your local machine can resolve names correctly.

  3. 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.
Resolution Complete: You have successfully flushed the local DNS cache and performed an upstream equipment reset. If name resolution errors persist after this comprehensive process, contact your Internet Service Provider (ISP) directly, as the issue may be outside of your local network control.
COMMAND LINE / TERMINAL
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.

Engineering Assistance

Need help implementing this solution?

Our cybersecurity and infrastructure engineers can audit, harden, or configure your systems directly.

Request Technical Assistance โ†’
Gurveer Singh
Gurveer Singh โœ“ Verified Author
Founder & CEO at hSECURITIES | Cybersecurity Educator | Security Researcher | Ethical Hacking Enthusiast | Technology Mentor
Meet the Founder โ†’

Gurveer Singh Saggu is the Founder and CEO of hSECURITIES, a cybersecurity and technology education platform focused on practical learning, digital security awareness, hardware diagnostics, Linux administration, and real-world cybersecurity training.

With a strong passion for technology, ethical hacking, and security education, he has spent years helping students, professionals, and organizations understand modern cyber threats and develop practical technical skills. Through hSECURITIES, he creates hands-on learning resources, technical guides, security awareness content, and community-driven initiatives that make cybersecurity more accessible.

His mission is to bridge the gap between theoretical knowledge and practical implementation by providing step-by-step learning experiences, technical troubleshooting resources, and security-focused educational platforms.

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.

Ask a Question or Share Solution