How to Flush DNS Cache on Windows and Mac (Fix Weird Website Errors)
Clear DNS cache on Windows 11 and macOS to fix pages that will not load, stale redirects, and ‘server not found’ errors after changing networks or VPNs.
When a website loads on your phone but fails on your PC — or you keep landing on yesterday’s login portal after leaving the office — flush the DNS cache before you reinstall the browser or reset Windows.
DNS (Domain Name System) is the phone book of the internet. Your PC remembers recent lookups so pages open faster. That memory goes stale after VPN hops, hotel WiFi, ISP redirects, or a site that changed servers overnight.
This guide covers Windows 11/10 and modern macOS with clear admin steps, a decision table, and what to try when a simple flush is not enough.
Skip random “network booster” or “DNS optimizer” junkware. The built-in commands below are safer and usually enough.
Decide what you are fixing
| Symptom | Likely cause | First move |
|---|---|---|
| Site works on phone data, fails on PC WiFi | Stale PC DNS or bad router DNS | Flush DNS, then test another resolver |
| Site works everywhere except after VPN disconnect | VPN left custom DNS | Quit VPN fully, flush DNS twice |
| Wrong captive portal / old office redirect | Cached resolver answer | Flush DNS + forget WiFi network |
| All sites fail, phone also fails | Router or ISP outage | Reboot router; skip DNS flush first |
| Only one browser fails | Browser host cache / extension | Hard refresh or clear site data |
If WiFi itself keeps dropping, fix that first in WiFi keeps disconnecting on Windows. If you use a VPN daily, set it up cleanly in VPN setup for Windows.
Windows 11 / 10: flush DNS
Standard flush (do this first)
- Right-click Start → Terminal (Admin) or Windows Terminal (Admin)
Or search Command Prompt → Run as administrator. - Run:
ipconfig /flushdns
You should see: Successfully flushed the DNS Resolver Cache.
- Close the browser completely (all windows), reopen it, and try the site in a new tab.
You can also view what was cached (optional):
ipconfig /displaydns
That list is long; use it only when you are hunting a specific hostname.
Deeper reset when flush alone fails
Still getting “server not found,” wrong redirects, or VPN leftovers? In the same elevated prompt:
ipconfig /release
ipconfig /renew
netsh winsock reset
netsh int ip reset
Then reboot. Winsock reset often clears broken layered providers left by old VPN or “optimizer” apps.
If Microsoft apps claim you are offline while Chrome works, that can be an account/token bug — see Microsoft account “no internet” sign-in after you finish the DNS steps.
Set temporary public DNS (test only)
- Settings → Network & internet → Wi-Fi (or Ethernet) → your network → DNS server assignment → Edit
- Choose Manual, turn IPv4 on
- Prefer 1.1.1.1 and alternate 1.0.0.1, or 8.8.8.8 / 8.8.4.4
- Save, flush DNS again, retest the site
If the site suddenly works, your ISP or router DNS was the problem. You can leave a reputable public resolver or fix DNS inside the router admin page for every device at home.
macOS: flush DNS
Apple’s exact helper has changed across versions; this pair still works on current macOS releases used in 2026:
- Open Terminal
- Run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Enter your Mac password (nothing appears as you type — that is normal)
- Quit the browser fully and reload the site
On some managed Macs, MDM profiles pin DNS. If flush works at home but never at work, ask IT before fighting the machine.
Optional check:
dscacheutil -q host -a name example.com
Replace example.com with the failing domain.
Browser cache vs DNS cache
Flushing OS DNS does not always clear a browser’s own host or HSTS state.
Try in order:
- Hard refresh: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)
- Test in a private/incognito window with extensions disabled
- Clear cached images/files and site data for that domain only
- Temporarily disable security extensions that rewrite DNS or HTTPS
Chrome fans who also see high CPU after a bad extension binge should clean that separately in Chrome high CPU fix.
After VPN, office WiFi, or travel
- Quit the VPN app fully (not just disconnect). Check the system tray / menu bar.
- Flush DNS on the OS again.
- Forget the hotel/café SSID and rejoin so a captive portal can refresh.
- Avoid stacking two VPNs or a VPN plus a “smart DNS” browser extension.
- Prefer audited VPN apps that set and clear their own DNS cleanly — the affiliate-style comparison link in the card above is a starting point, not a magic cure.
Never install cracked VPN clients or “free DNS booster” EXEs from pop-up ads. Those are a common path to adware; if you already clicked one, use remove malware from Windows.
Verify the fix
On Windows (Command Prompt):
nslookup your-problem-site.com
On Mac:
dig your-problem-site.com +short
You want a sensible IP answer and a resolver you recognise (your router, ISP, 1.1.1.1, 8.8.8.8, or your VPN’s DNS). If nslookup fails but the phone on mobile data works, stay on the DNS/router path — do not jump to a Windows reset.
Router and whole-home notes
- Reboot the router after ISP outages; many “DNS” tickets are stale router caches.
- If every device fails one site, the problem is upstream or the site itself.
- Parental-control or “security” DNS on the router can block categories and look like breakage — check before you reinstall browsers.
- On Windows, a full Network reset (Settings → Network & internet → Advanced network settings → Network reset) is a last resort after flush + Winsock; it removes WiFi passwords, so have them ready.
Quick checklist
- Confirm phone vs PC behaviour
- Flush DNS (Windows or Mac)
- Quit VPN; flush again
- Try 1.1.1.1 / 8.8.8.8 temporarily
- Hard refresh / private window
- Forget WiFi or reboot router
- Only then consider deeper network reset
This ten-minute habit fixes a surprising number of “the internet is broken” tickets that are really just stale DNS. Keep the commands handy; you will reuse them every time you hop networks.
Frequently Asked Questions
What does flushing DNS do?
It clears locally stored domain-to-IP lookups so your device fetches fresh DNS records from the resolver. It does not change your files, passwords, or browser bookmarks.
Will I lose files by flushing DNS?
No. It only clears the network lookup cache. Your documents and apps stay untouched.
When should I flush DNS?
After VPN use, moving between offices/home/café WiFi, seeing old site redirects, or when a site loads on your phone but not your PC.
Do I need Administrator or sudo?
On Windows, an elevated Command Prompt is best for a full flush and Winsock reset. On Mac, sudo is required for the standard flush commands.
Flushing DNS did not fix the site — what next?
Try a different resolver (1.1.1.1 or 8.8.8.8), clear the browser host cache, forget/rejoin WiFi, then check router DNS. See also our WiFi disconnect and VPN guides.
Related fixes
How to Clear System Cache on Mac (Speed Up macOS in 2026)
Speed up a slow Mac in 2026 by safely clearing user cache, system cache, font caches, and leftover app junk — without deleting the files you care about.
Read the fixTime Machine Not Backing Up on Mac? Fix It Without Losing Archives
Repair Time Machine on macOS: stuck Preparing Backup, disk not recognized, sparsebundle errors on network drives, and permission fixes pros try first.
Read the fixMacBook Caps Lock Stuck On? Software and Hardware Fixes
Caps Lock LED stays on or types ALL CAPS on a MacBook — accessibility settings, stuck switch, remapping, and when the key mechanism needs service.
Read the fix