You visit a website and it won’t load, shows an old version, or points to the wrong place — even though you know the site is fine and its address is correct. Often the culprit is your DNS cache: a local store of domain-to-IP records your device keeps to speed things up. When one of those records goes stale — after a site moves servers, you change DNS providers, or a record is updated — your device keeps using the old, cached answer. Flushing the DNS cache clears that store and forces a fresh lookup.
It’s a quick, safe fix, and this guide gives you the exact commands for every platform — Windows, macOS (all versions), Linux, Chrome, Android, and iOS — plus how to check which resolver you’re on, how to verify the flush worked, and the one situation where flushing won’t help.
To flush the DNS cache, run the command for your system:
Windows: ipconfig /flushdns
macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux: sudo resolvectl flush-caches (systemd-resolved)On Windows you’ll see “Successfully flushed the DNS Resolver Cache.” macOS shows no message (that’s normal). Don’t forget Chrome keeps its own cache — clear it at chrome://net-internals/#dns.
Table of Contents
What is a DNS cache (and why flush it)?
Every time you visit a site, your device asks a DNS server to translate the domain name (like copahost.com) into an IP address. To avoid repeating that lookup for every page and image, your system stores the answer locally for a while — that’s the DNS cache. It makes browsing faster, and each entry has a lifespan set by its TTL (time to live), after which it expires on its own.
Most of the time the cache is invisible and helpful. You flush it manually when an entry goes stale before its TTL expires and starts causing problems — for example:
- You changed DNS records or nameservers (or migrated hosting) and want to see the new destination immediately instead of the old cached one.
- A site won’t load or loads an old version on your device but works fine elsewhere.
- You switched DNS providers or networks (or connected a VPN) and want a clean slate.
- Security: clearing the cache removes any entries that may have been poisoned by DNS spoofing, forcing fresh, verified lookups.
Flushing is completely safe — it doesn’t delete personal data, passwords, or browsing history. It just clears the domain-to-IP shortcuts, which are rebuilt automatically on your next visit.
How to flush DNS on Windows
Windows uses the same command across Windows 7, 8, 10, and 11. Open Command Prompt as administrator (press Start, type cmd, right-click Command Prompt → Run as administrator), then run:
ipconfig /flushdnsYou’ll see the confirmation: “Successfully flushed the DNS Resolver Cache.” (PowerShell works too, with the same command, or Clear-DnsClientCache.)
To see the cache before flushing — useful for troubleshooting — run ipconfig /displaydns. And if name resolution is still broken after flushing, renewing your IP often helps:
ipconfig /release
ipconfig /renew
ipconfig /flushdnsFor a stubborn case where resolution stays broken even after flushing and renewing, resetting the network socket catalog can help. Run this as administrator, then reboot:
netsh winsock resetHow to flush DNS on macOS
On macOS, open Terminal (Applications → Utilities → Terminal, or Spotlight → “Terminal”) and run the command for your version. For Big Sur (11), Monterey (12), Ventura (13), Sonoma (14), Sequoia (15) and most recent releases:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderEnter your admin password when prompted (it won’t display as you type — that’s normal). macOS shows no confirmation message even on success; if there’s no error, it worked.
Older versions used different commands:
| macOS version | Command |
|---|---|
| Big Sur (11) → Sequoia (15) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| El Capitan (10.11) → Catalina (10.15) | sudo killall -HUP mDNSResponder |
| Yosemite (10.10) | sudo discoveryutil udnsflushcaches |
| Lion (10.7) → Mavericks (10.9) | sudo killall -HUP mDNSResponder |
| Snow Leopard (10.6) | sudo dscacheutil -flushcache |
How to flush DNS on Linux
Linux is different: there’s no single DNS cache — it depends on which resolver service your distribution runs (or whether it caches at all). So first find out what you’re using. This command shows what’s listening on the DNS port (53):
sudo ss -lntp | grep :53Then flush the cache for the service you actually have:
# systemd-resolved (Ubuntu 18.04+, Debian, Fedora, Arch)
sudo resolvectl flush-caches
# older systemd: sudo systemd-resolve --flush-caches# dnsmasq
sudo systemctl restart dnsmasq# nscd (Name Service Caching Daemon)
sudo systemctl restart nscd# BIND (named)
sudo rndc flushIf you run a command and get “service not found,” that resolver isn’t installed — check with the ss command above and use the one that matches. Some minimal Linux setups don’t cache DNS locally at all, in which case there’s nothing to flush.
How to flush the Chrome DNS cache
Here’s what trips people up: Chrome keeps its own DNS cache, separate from your operating system’s. So even after flushing at the OS level, Chrome may still resolve an old address. Clear Chrome’s cache by typing this into the address bar:
chrome://net-internals/#dnsClick “Clear host cache.” (The same page exists in other Chromium browsers like Edge and Brave, at edge://net-internals/#dns and so on.) For a stubborn case, close and reopen the browser, or use an incognito window to bypass cached content. Safari has no separate DNS page — flushing macOS handles it. Firefox uses its own cache too; clear it at about:networking#dns → “Clear DNS Cache.”
One modern caveat: if your browser has DNS over HTTPS (DoH) enabled, it may resolve names through its own encrypted resolver, bypassing the system cache entirely — so an OS-level flush won’t affect it. Clear the browser’s own host cache (above), or temporarily disable DoH while troubleshooting. More on this in our guide to encrypted DNS.
How to flush DNS on Android and iOS
Mobile devices cache DNS as well:
- Android: there’s no system command, but you can clear it by toggling Airplane mode on and off (the quickest way), restarting the device, or clearing Chrome’s cache via
chrome://net-internals/#dnsin mobile Chrome. - iOS (iPhone/iPad): toggle Airplane mode on and off, or restart the device. iOS clears its DNS cache on reboot and network changes.
How to verify the flush worked
After flushing, confirm you’re getting fresh answers. On any system you can look up a domain directly:
nslookup copahost.com # Windows, macOS, Linux
dig copahost.com # macOS, Linux (more detail)Check that the returned IP matches the new, expected address. On Windows, ipconfig /displaydns right after a flush should show an almost-empty cache. If a site still resolves to the old IP from every tool, the issue isn’t your cache — it’s propagation (below).
Flushing clears your cache — it can’t speed up DNS propagation across the internet. If you just changed a DNS record, other networks and resolvers worldwide may still hold the old value for up to 24–48 hours, and no local flush fixes that. See our guide on DNS propagation for what’s actually happening.
Still not resolving? Other DNS fixes
If flushing didn’t solve it, the problem may be elsewhere:
- Restart your router. It has its own DNS cache; power-cycle it for ~30 seconds to clear stale entries network-wide.
- Check your hosts file. A manual entry there overrides DNS entirely:
C:\Windows\System32\drivers\etc\hostson Windows,/etc/hostson macOS/Linux. Remove stale lines. - Switch to a public resolver. If your ISP’s DNS is unreliable, try Google (8.8.8.8) or Cloudflare (1.1.1.1). See our guide on the best DNS servers and how to change them.
- Slow lookups rather than wrong ones? That’s a different problem — see how to fix slow DNS lookups.
- Seeing a specific error? DNS_PROBE_FINISHED_NXDOMAIN, DNS_PROBE_STARTED, and DNS_PROBE_FINISHED_NO_INTERNET each have their own dedicated fixes.
If the error you’re seeing is “DNS server not responding”, flushing is only the first step — you may also need to restart your router or switch to a public DNS.
Frequently asked questions
What does flushing DNS do?
It clears your device’s local store of domain-to-IP records, forcing your system to fetch fresh information from the DNS server on the next lookup. This resolves problems caused by outdated or corrupted cached entries — like a site not loading or pointing to an old server after a DNS change.
Is it safe to flush DNS?
Yes, completely. Flushing only clears cached domain-to-IP lookups, which are rebuilt automatically as you browse. It doesn’t delete personal data, passwords, bookmarks, or browsing history, and it doesn’t affect your internet connection.
How do I flush DNS on Windows?
Open Command Prompt as administrator, type ipconfig /flushdns, and press Enter. You’ll see “Successfully flushed the DNS Resolver Cache.” The same command works on Windows 7, 8, 10, and 11, and in PowerShell.
Why does Chrome still show the old site after I flushed DNS?
Because Chrome keeps its own DNS cache, separate from your operating system’s. Clear it by going to chrome://net-internals/#dns and clicking “Clear host cache.” You may need to flush both the OS and Chrome to fully clear a stale record.
Does flushing DNS speed up propagation?
No. Flushing only affects your own device’s cache. When you change a DNS record, resolvers around the world still hold the old value until their TTL expires — up to 24–48 hours. No local flush can force the rest of the internet to update faster.
How often should I flush my DNS cache?
There’s no need to do it routinely — the cache expires on its own via TTL. Flush it when troubleshooting a specific problem: a site not loading, wrong or outdated resolution, after changing DNS settings, or when switching networks or providers.
Migrating a site or changing records? Copahost hosting includes fast, correctly configured DNS and support that helps your changes propagate cleanly — so “flush and wait” is all you ever need to do.
Explore Copahost hostingConclusion
Flushing the DNS cache is one of the simplest and safest troubleshooting steps there is: a single command per platform, and your device starts asking for fresh directions instead of following an outdated map. On Windows it’s ipconfig /flushdns, on macOS the dscacheutil/mDNSResponder pair, on Linux whichever resolver you run, and don’t forget Chrome’s separate cache at chrome://net-internals/#dns. Verify with nslookup or dig, and remember the one thing a flush can’t do — hurry along global DNS propagation. For anything deeper on how the whole system works, start with our guide to what DNS is and how it works.
Migrating a site or changing records? See our website migration checklist for the full sequence.
