How to Flush DNS Cache on Any Device (Windows, Mac, Linux, Chrome)

3 min read
Beginner DNS Cache Fix Networking

Quick Answer: Windows: ipconfig /flushdns in Command Prompt (admin). Mac: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal. Linux: sudo resolvectl flush-caches. Chrome: go to chrome://net-internals/#dns and click Clear host cache. iPhone/Android: toggle Airplane Mode on and off.

Your computer remembers the IP addresses of websites you visit so it does not have to look them up every time. This is called the DNS cache. Usually it helps — but when a website changes its IP address, moves servers, or you get a DNS error, the cache can serve outdated information.

Flushing (clearing) the DNS cache forces your device to look up fresh DNS records. This fixes a surprising number of problems:

  • DNS_PROBE_FINISHED_NXDOMAIN errors
  • Websites that work on your phone but not your computer
  • Old redirects that should have changed
  • Sites that recently migrated to a new server

Flush DNS on Windows

Open Command Prompt or PowerShell as administrator:

ipconfig /flushdns

You should see: "Successfully flushed the DNS Resolver Cache."

Verify it worked:

ipconfig /displaydns

This should show a nearly empty list.

Flush DNS on Mac

Open Terminal and run:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Enter your Mac password when prompted. There is no confirmation message — if there is no error, it worked.

Which macOS version?

The command above works on macOS Monterey and later. For older versions:

macOS Version Command
Monterey+ (12+) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Big Sur (11) Same as above
Catalina (10.15) Same as above
Mojave (10.14) sudo killall -HUP mDNSResponder
High Sierra (10.13) sudo killall -HUP mDNSResponder

Flush DNS on Linux

The command depends on which DNS resolver you use:

systemd-resolved (Ubuntu 18+, most modern distros):

sudo resolvectl flush-caches

Verify:

sudo resolvectl statistics | grep "Current Cache Size"

nscd (older systems):

sudo systemctl restart nscd

dnsmasq:

sudo systemctl restart dnsmasq

Flush DNS in Chrome

Chrome has its own internal DNS cache, separate from your operating system.

  1. Open Chrome and type in the address bar: chrome://net-internals/#dns
  2. Click Clear host cache
  3. Then go to: chrome://net-internals/#sockets
  4. Click Flush socket pools

This is important — even after flushing your OS DNS cache, Chrome might still use its own cached results.

Flush DNS in Firefox

Firefox does not have a persistent DNS cache by default, but you can clear it:

  1. Type about:networking#dns in the address bar
  2. Click Clear DNS Cache

Flush DNS in Edge

Edge uses the same Chromium cache as Chrome:

  1. Type edge://net-internals/#dns in the address bar
  2. Click Clear host cache

Flush DNS on iPhone

iPhones do not have a flush DNS command. Instead:

  1. Toggle Airplane Mode: Settings → Airplane Mode → ON → wait 10 seconds → OFF
  2. Restart your iPhone: This clears the DNS cache completely
  3. Forget and rejoin WiFi: Settings → WiFi → tap (i) → Forget This Network → reconnect

Flush DNS on Android

Android also does not have a direct flush command:

  1. Toggle Airplane Mode: Swipe down → Airplane Mode → ON → wait 10 seconds → OFF
  2. Clear Chrome cache: Chrome → Settings → Privacy → Clear browsing data → check "Cached images and files"
  3. Restart your phone: The most reliable method

When to Flush DNS

Situation Will Flushing Help?
Website shows DNS_PROBE_FINISHED_NXDOMAIN Yes — most common fix
Website works on phone but not computer Yes — stale cache on computer
Recently changed DNS servers Yes — old DNS still cached
Website just migrated to new server Yes — old IP cached
Website is genuinely down No — flushing will not bring it back
Slow internet speed No — DNS cache is not the cause
VPN not working Maybe — try after reconnecting VPN

After Flushing: Test Your DNS

See Also