🖥️ Complete Guide to Flushing DNS Cache on Windows 11/10, macOS, and Linux - XP Down Detector

Complete Guide to Flushing DNS Cache on Windows 11/10, macOS, and Linux

When a website updates its hosting server, migrates to a new IP address, or recovers from a major outage, you might find that your computer still refuses to load the page while your phone on cellular data opens it immediately.

The primary culprit behind this discrepancy is stale local DNS caching.

To speed up everyday web browsing, operating systems and modern web browsers save recent domain name lookups in a temporary database called the DNS Resolver Cache. However, when an IP address changes or a temporary outage record is saved, your system continues trying to connect to the obsolete server until the cache expires.

Flushing the DNS cache purges all cached lookup tables and forces your device to request fresh, authoritative records directly from the internet. This complete tutorial covers how to flush DNS across Windows, macOS, Linux, and web browsers.


When Should You Flush Your DNS Cache?

Flushing your DNS resolver cache is an essential troubleshooting step when:

  1. A website recently recovered from downtime: If XP Down Detector shows a service has returned to "Normal" status, but your browser still displays a connection timeout or 502/503 error, your local cache is likely retaining the stale outage state.
  2. You modified domain DNS records: If you updated A, CNAME, or MX records for your own domain and want to inspect the changes immediately.
  3. Resolving DNS_PROBE_FINISHED_NXDOMAIN or ERR_NAME_NOT_RESOLVED: These browser errors directly signify that your local resolver believes the domain name does not exist.
  4. Clearing DNS Poisoning / Spoofing: If you suspect malware or a rogue public Wi-Fi network altered your local DNS lookup tables.

How to Flush DNS on Windows 11 and Windows 10

Windows makes it simple to clear the DNS cache using the command prompt:

  1. Press the Windows Key and type cmd.
  2. Right-click on Command Prompt and select Run as Administrator (or press Ctrl + Shift + Enter).
  3. In the command prompt window, type the following command and press Enter:
    ipconfig /flushdns
    
  4. Within a second, Windows will display the confirmation output:
    Windows IP Configuration
    Successfully flushed the DNS Resolver Cache.
    
  5. (Optional) To view remaining cached DNS entries in Windows, run:
    ipconfig /displaydns
    

How to Flush DNS on macOS (Sonoma, Ventura, Monterey, and Older)

Because Apple uses different internal DNS daemons (mDNSResponder and dscacheutil) across macOS versions, the terminal command combines both flushing and restarting the responder process.

  1. Press Cmd + Space to open Spotlight, type Terminal, and press Enter.
  2. Copy and paste the command corresponding to your macOS version:

For macOS Sonoma, Ventura, Monterey, and Big Sur:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  1. Press Enter and type your macOS administrator password (keystrokes will remain invisible for security).
  2. macOS will not print a success confirmation, but returning to a blank prompt indicates the cache has been cleared and the DNS responder daemon has restarted with fresh lookup tables.

How to Flush DNS on Linux (Ubuntu, Debian, Fedora, Arch)

Unlike Windows and macOS, not all Linux distributions run a local DNS cache by default. However, most modern distributions running systemd use systemd-resolved or dnsmasq.

For distributions using systemd-resolved (Ubuntu 20.04+, Debian, Fedora):

  1. Open a terminal window and run:
    sudo resolvectl flush-caches
    
    (On older systemd versions, use: sudo systemd-resolve --flush-caches)
  2. To verify the cache statistics and size, execute:
    resolvectl statistics
    
    You should see Current Cache Size: 0.

For distributions using dnsmasq:

sudo systemctl restart dnsmasq

Flushing DNS Cache Inside Web Browsers

Modern Chromium-based web browsers (Google Chrome, Microsoft Edge, Brave, Opera) maintain a secondary, internal DNS cache independent of your operating system. If flushing your OS cache does not resolve the issue, clear the browser's internal host cache:

In Google Chrome:

  1. Open a new tab and paste this into the address bar:
    chrome://net-internals/#dns
    
  2. Click the Clear host cache button.
  3. Paste this into the address bar to clear active socket pools:
    chrome://net-internals/#sockets
    
  4. Click Flush socket pools.

In Microsoft Edge:

  1. Navigate to:
    edge://net-internals/#dns
    
  2. Click Clear host cache.

Summary Checklist

  1. Flush the OS DNS cache (ipconfig /flushdns on Windows, killall -HUP mDNSResponder on Mac).
  2. Clear internal browser host cache via chrome://net-internals/#dns.
  3. Restart your browser.
  4. Verify whether the service is genuinely operational by checking the live status on XP Down Detector or running our Speed Test tool.

Experiencing an outage right now? Check the latest status directly from our live dashboard:

⚡ Open Realtime Status Dashboard