How to Flush DNS Cache on Windows, Mac, iPhone and Android

Flushing your DNS cache clears the stored record of which IP address belongs to which domain, forcing your device to look it up fresh. It fixes sites that won’t load, “server not found” errors after a site has moved, and stale results that persist even though everything else works.

It’s a thirty-second fix. But it only clears one of five places DNS gets cached — which is why it sometimes appears to do nothing at all. This guide covers the commands and, more usefully, what to do when they don’t help.

Key Takeaway:
Your device is the last link in a chain of caches. Your browser, your OS, your router, and your ISP’s resolver each keep their own copy — and you can only clear the first three.


What the DNS Cache Actually Is

Every time you visit a site, your device asks a resolver to translate the domain into an IP address. Doing that on every single request would be wasteful, so the answer is stored locally for reuse.

Each record arrives with a TTL (Time To Live) set by the domain’s owner — anything from five minutes to a day. Until the TTL expires, your device reuses the stored answer without asking anyone.

That’s excellent for speed and terrible when the answer changes. If a site moves to a new server, your cached record keeps pointing at the old one until the TTL runs out. Flushing just forces that expiry early. Background: how DNS works.

When Flushing Helps — and When It Won’t

SituationWill Flushing Fix It?
Site moved server, you still hit the old one✅ Yes
“Server not found” on one site only✅ Often
You just changed your DNS server✅ Yes — required, or old answers persist
You edited your hosts file✅ Yes
Site shows an old design or old content❌ No — that’s your browser cache, not DNS
Nothing loads at all❌ No — a connection problem
Site is down for everyone❌ No

The Five Layers of DNS Caching

This explains the “I flushed it and nothing changed” experience:

  1. Your browser — Chrome and Firefox keep their own DNS caches, separate from the OS.
  2. Your operating system — what ipconfig /flushdns and its equivalents clear.
  3. Your router — most home routers cache DNS for the whole network.
  4. Your ISP’s resolver — caches on their side, and you cannot clear it.
  5. The authoritative server — the source of truth, which is what everything eventually re-checks.

Flushing your device clears layers 1 and 2. If the stale record lives at layer 3 or 4, nothing you type locally will help — see the workaround further down.

Windows 10 / 11

  1. Press Win + R, type cmd, then Ctrl+Shift+Enter to run as administrator.
  2. Run: ipconfig /flushdns
  3. You should see “Successfully flushed the DNS Resolver Cache.”

To inspect the cache before clearing it, run ipconfig /displaydns. For a fuller network reset, follow with ipconfig /release then ipconfig /renew.

macOS

In Terminal, for Monterey, Ventura, Sonoma and later:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Enter your admin password. There’s no confirmation message — silence means it worked.

Linux

Depends on what’s managing DNS. On modern systemd distributions:

  • sudo resolvectl flush-caches
  • Older systemd: sudo systemd-resolve --flush-caches
  • Running nscd: sudo systemctl restart nscd

Many minimal Linux setups don’t cache DNS at all, in which case there’s nothing to flush.

Browsers

Browsers keep separate caches, so clear these too if a single site misbehaves in one browser only:

  • Chrome / Edge: go to chrome://net-internals/#dns → Clear host cache. Then chrome://net-internals/#sockets → Flush socket pools.
  • Firefox: go to about:networking#dns → Clear DNS Cache.

Note that if your browser has secure DNS enabled it resolves independently of your system — see DNS over HTTPS.

iPhone and Android

Neither offers a direct flush command. In order of effort:

  • Toggle Airplane Mode on, wait ten seconds, off. Usually enough.
  • iPhone: Settings → Wi-Fi → ⓘ → Renew Lease.
  • Android: clear Chrome’s host cache at chrome://net-internals/#dns.
  • Restart the device — the most thorough option on either platform.

Your Router

Frequently the real culprit, and frequently skipped. Your router caches DNS for every device on the network, so a stale record there survives any amount of flushing on your laptop.

Simply restart it: unplug for 30 seconds, plug back in. Some admin panels also offer an explicit DNS cache clear under maintenance or diagnostics.

Verify It Worked

  • Run our DNS Checker to see which IP the domain now resolves to.
  • Windows: nslookup example.com
  • Mac / Linux: dig example.com +short

Compare the result against what you expect. If it still returns the old address, the stale copy is upstream of you.

If Flushing Didn’t Fix It

When the stale record is cached at your ISP’s resolver, you can’t clear it — but you can go around it. Switch your DNS to a public resolver such as 1.1.1.1 or 8.8.8.8, which has its own independent cache and will very likely return the correct answer immediately.

Instructions per platform: How to Check (and Change) Your DNS Settings.

If that doesn’t work either, the record genuinely hasn’t propagated yet — DNS changes can take up to 48 hours to spread, and that’s simply TTL expiry working its way across the internet. Nothing on your end can accelerate it.

Still broken? Try DNS_PROBE_FINISHED_NXDOMAIN, ERR_NAME_NOT_RESOLVED, or DNS server not responding.


Frequently Asked Questions

Is flushing DNS safe?

Completely. It deletes temporary lookup records that rebuild automatically. Nothing personal is lost and nothing breaks — the next few page loads are just marginally slower.

How often should I do it?

Only when troubleshooting. The cache is a performance feature and expires on its own; clearing it routinely achieves nothing useful.

Why didn’t it fix my problem?

Most likely the stale record is at your router or your ISP’s resolver rather than on your device. Restart the router, then switch to a public DNS server.

Is DNS cache the same as browser cache?

No, and it’s a common mix-up. DNS cache stores addresses; browser cache stores page content. If a site shows an outdated design, clear your browser cache instead — flushing DNS won’t touch it.

Does it clear my browsing history?

No. It’s unrelated to history, cookies or saved logins, and it isn’t a privacy measure — your ISP’s record of your lookups is unaffected.

Do I need admin rights?

Yes on Windows, macOS and Linux — the command fails or does nothing without them. On phones, the airplane-mode method needs no special permissions.

Will it fix a slow connection?

Only if the slowness came from stale or failing lookups. General slowness is a different problem — see how to fix slow internet.

What is DNS propagation?

The period after a domain’s IP changes during which resolvers worldwide still hold the old record. It isn’t a process you can trigger or speed up — it’s simply every cache waiting for its TTL to expire, which can take up to 48 hours.


Related Reading

Scroll to Top