Quick Answer: Windows:
ipconfig /flushdnsin Command Prompt (admin). Mac:sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderin Terminal. Linux:sudo resolvectl flush-caches. Chrome: go tochrome://net-internals/#dnsand 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.
- Open Chrome and type in the address bar:
chrome://net-internals/#dns - Click Clear host cache
- Then go to:
chrome://net-internals/#sockets - 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:
- Type
about:networking#dnsin the address bar - Click Clear DNS Cache
Flush DNS in Edge
Edge uses the same Chromium cache as Chrome:
- Type
edge://net-internals/#dnsin the address bar - Click Clear host cache
Flush DNS on iPhone
iPhones do not have a flush DNS command. Instead:
- Toggle Airplane Mode: Settings → Airplane Mode → ON → wait 10 seconds → OFF
- Restart your iPhone: This clears the DNS cache completely
- 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:
- Toggle Airplane Mode: Swipe down → Airplane Mode → ON → wait 10 seconds → OFF
- Clear Chrome cache: Chrome → Settings → Privacy → Clear browsing data → check "Cached images and files"
- 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
- DNS Toolbox — look up DNS records for any domain
- What's My IP — verify your connection
- VPN Leak Test — check if your DNS is leaking through your VPN