Skip to content
Network server lights representing DNS

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.

10 min readDNS, flush DNS, Windows

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)

  1. Right-click StartTerminal (Admin) or Windows Terminal (Admin)
    Or search Command PromptRun as administrator.
  2. Run:
ipconfig /flushdns

You should see: Successfully flushed the DNS Resolver Cache.

  1. 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)

  1. Settings → Network & internet → Wi-Fi (or Ethernet) → your network → DNS server assignment → Edit
  2. Choose Manual, turn IPv4 on
  3. Prefer 1.1.1.1 and alternate 1.0.0.1, or 8.8.8.8 / 8.8.4.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:

  1. Open Terminal
  2. Run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  1. Enter your Mac password (nothing appears as you type — that is normal)
  2. 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:

  1. Hard refresh: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)
  2. Test in a private/incognito window with extensions disabled
  3. Clear cached images/files and site data for that domain only
  4. 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

  1. Quit the VPN app fully (not just disconnect). Check the system tray / menu bar.
  2. Flush DNS on the OS again.
  3. Forget the hotel/café SSID and rejoin so a captive portal can refresh.
  4. Avoid stacking two VPNs or a VPN plus a “smart DNS” browser extension.
  5. 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

  1. Confirm phone vs PC behaviour
  2. Flush DNS (Windows or Mac)
  3. Quit VPN; flush again
  4. Try 1.1.1.1 / 8.8.8.8 temporarily
  5. Hard refresh / private window
  6. Forget WiFi or reboot router
  7. 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.