DNS cache stores recently resolved domain-to-IP mappings so your computer doesn't have to query DNS servers for every request. But when DNS records change — after migrating hosting, updating MX records, or switching CDN providers — stale cache entries can send you to old servers long after the actual records have updated. This guide covers exactly how to clear DNS cache on every major platform, browser, and even your home router.
What Is DNS Cache?
DNS cache is a temporary database maintained by your operating system, browser, and router that stores the results of recent DNS lookups. When you visit example.com, your computer asks a DNS resolver "what's the IP address?" The answer gets cached so the next visit skips the lookup entirely — making page loads faster. But this speed comes at a cost: if the DNS records change, your cache still points to the old IP until it expires (based on TTL) or you manually flush it.
There are actually four layers where DNS cache can live:
- Browser cache — Chrome, Firefox, Edge each maintain their own DNS cache (typically 1–2 minutes)
- OS cache — macOS, Windows, and Linux each have a system-level DNS resolver cache
- Router cache — Your home/office router often runs a DNS proxy with its own cache
- ISP resolver cache — Your internet provider's DNS servers cache records too (you can't flush this one)
🔍 Check if your DNS changes are live: Use our free DNS Record Lookup to query Google Public DNS (8.8.8.8) and see current record values — bypasses your local cache entirely.
Quick Reference: All Flush Commands
| Platform | Command | Notes |
|---|---|---|
| macOS Sequoia / Sonoma | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
Works on macOS 10.7+ |
| macOS (older) | sudo killall -HUP mDNSResponder |
10.7 – 14.x |
| Windows 11 / 10 | ipconfig /flushdns |
Run in Command Prompt (Admin) |
| Linux (systemd-resolved) | sudo resolvectl flush-caches |
Ubuntu 18.04+, Fedora 33+ |
| Linux (nscd) | sudo service nscd restart |
Older distros |
| Linux (dnsmasq) | sudo systemctl restart dnsmasq |
Common on servers |
| Chrome | chrome://net-internals/#dns → "Clear host cache" |
Also clears socket pools |
| Firefox | about:networking#dns → "Clear DNS Cache" |
|
| Edge | edge://net-internals/#dns → "Clear host cache" |
Same engine as Chrome |
| Home Router | Power-cycle or admin panel → "Flush DNS" / Reboot | Varies by model |
macOS: Clear DNS Cache
macOS uses mDNSResponder for DNS resolution. The flush command has changed slightly across versions, but the core approach is the same.
macOS Sequoia 15 / Sonoma 14 / Ventura 13
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Enter your admin password when prompted. The first command flushes the directory service cache (which includes DNS); the second restarts the mDNS responder daemon. There's no output on success — that means it worked.
macOS Monterey 12 / Big Sur 11 / Catalina 10.15
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
This command has been stable since macOS 10.7 Lion. On older versions (10.6 and below), use sudo dscacheutil -flushcache alone.
sudo dscacheutil -cachedump -entries host 2>/dev/null | head -20
This shows current DNS cache entries. Right after flushing, the output should be empty or nearly empty.
Windows: Clear DNS Cache
Windows 11 / 10 / 8.1 / 8
ipconfig /flushdns
You should see: Successfully flushed the DNS Resolver Cache.
Additional Windows DNS Commands
ipconfig /displaydns
netsh int ip reset
netsh winsock reset
⚠️ Note: The netsh reset commands require a reboot and will reset all TCP/IP settings — not just DNS. Use only when ipconfig /flushdns doesn't resolve the issue.
Linux: Clear DNS Cache
Linux DNS caching depends on which resolver your distribution uses. Modern distributions (Ubuntu 18.04+, Fedora 33+, Debian 12+) use systemd-resolved. Older systems may use nscd or dnsmasq.
Linux systemd-resolved (Ubuntu, Fedora, Debian, Arch)
sudo resolvectl flush-caches
sudo resolvectl statistics
If resolvectl isn't found, try the older command name: sudo systemd-resolve --flush-caches.
Linux nscd (Name Service Cache Daemon)
sudo service nscd restart
# or
sudo systemctl restart nscd
sudo nscd -i hosts
Linux dnsmasq (common on servers & routers)
sudo systemctl restart dnsmasq
sudo killall -USR1 dnsmasq
Browser DNS Cache
Browsers maintain their own DNS cache independent of the OS. If you've cleared the OS cache but still see old DNS results in your browser, the browser cache is the culprit. Each browser has an internal page for network debugging.
Chrome / Brave / Arc / Chromium
- Open
chrome://net-internals/#dns - Click "Clear host cache"
- Optionally: go to
chrome://net-internals/#sockets→ "Flush socket pools" (clears idle TCP connections to old IPs)
No restart needed — the flush takes effect immediately for new connections.
Firefox
- Open
about:networking#dns - Click "Clear DNS Cache"
Firefox's DNS cache TTL is 60 seconds by default, so it usually clears faster than Chrome's.
Edge
- Open
edge://net-internals/#dns - Click "Clear host cache"
Edge uses the Chromium engine, so the process is identical to Chrome.
Safari
Safari doesn't have a standalone DNS cache clear. Instead:
- Menu bar → Develop → Empty Caches (
Cmd+Option+E) - If the Develop menu isn't visible: Safari → Settings → Advanced → check "Show Develop menu in menu bar"
This clears all Safari caches including DNS. For a more thorough flush, quit Safari and clear the OS-level DNS cache (above) before reopening.
Router & Modem DNS Cache
Most home routers run a DNS proxy (often dnsmasq) that caches lookups for every device on your network. If every device on your network sees stale results, the router is the likely culprit.
How to Clear Router DNS Cache
- Power-cycle: Unplug the router, wait 30 seconds, plug it back in. This is the simplest method and works for all consumer routers.
- Admin panel: Log into your router's admin page (typically
192.168.1.1or192.168.0.1), find the DNS or Advanced settings section, and look for "Flush DNS" or "Clear DNS Cache". - Change DNS servers: Some routers only flush cache when you switch DNS providers. Temporarily switch from your ISP's DNS to Cloudflare (1.1.1.1) or Google (8.8.8.8) and back.
🛠 Verify DNS changes are live across the internet: Use our DNS Record Lookup — queries Google's public DNS (8.8.8.8) directly, so it shows what the rest of the world sees, not your local cache. Also check What is DNS? to understand TTL and propagation timing.
How to Verify DNS Cache Is Cleared
After flushing, how do you know it actually worked? Here's a systematic verification approach:
1. Check Your DNS Records From Outside
Use our DNS Record Lookup tool to query the domain. It queries Google's public DNS (8.8.8.8), bypassing your local cache entirely. Compare what you see in the tool with what you see locally.
2. Compare With Command Line (post-flush)
dig example.com A +short
nslookup example.com
3. Use Multiple Resolvers
Query different public DNS servers to see if propagation is complete:
dig example.com @8.8.8.8 +short # Google
dig example.com @1.1.1.1 +short # Cloudflare
dig example.com @9.9.9.9 +short # Quad9
If all return the same new IP, propagation is complete. If some return old values, DNS TTL hasn't expired on those resolvers yet — wait and check again.
When Should You Clear DNS Cache?
Common scenarios where flushing DNS cache solves the problem:
- After changing web hosting — Your domain points to the new server's IP, but your computer still resolves to the old one
- After updating DNS records — A, CNAME, MX changes that haven't "taken effect" on your machine
- After switching CDN providers — Cloudflare, Fastly, or Akamai changes not reflecting locally
- Getting "Server not found" errors — For sites you know are up and accessible from other networks
- DNS spoofing concerns — If you suspect DNS cache poisoning attacks (rare but serious)
- VPN disconnect issues — DNS cache can retain VPN-specific entries after disconnecting
- Local development — Switching between local/staging/production servers via hosts file and DNS
Troubleshooting: Flush Didn't Work
You ran the flush command but still see old DNS results. Here's what to check, in order:
- Browser cache is the culprit. After flushing the OS cache, restart your browser completely (not just close tabs — quit the application). Or clear the browser's DNS cache using the internal pages shown above.
- Your router is caching. If multiple devices on the same network see old results, power-cycle the router.
- TTL hasn't expired on upstream resolvers. Your ISP's DNS servers and public resolvers like Google (8.8.8.8) cache records based on TTL. Check the SOA record's
minimumTTL field to see how long other resolvers will cache the old value. Use our DNS Record Lookup and select "SOA" to check. - You're checking the wrong domain. Verify you're querying the exact domain you changed —
www.example.comandexample.comare separate DNS records with separate caches. - The DNS change hasn't propagated yet. If you just made the change, give it 5–30 minutes. Check propagation with a tool like whatsmydns.net to see results from DNS servers worldwide.
🔧 Still seeing old records? Try our DNS Record Lookup against multiple record types (A, AAAA, CNAME, MX, TXT) simultaneously. Cross-reference with WHOIS Lookup to confirm the domain's nameservers match your registrar settings.
FAQ
How often should I clear DNS cache?
You rarely need to clear DNS cache proactively. Only flush when you've made DNS changes and need to see the new results immediately, or when you're experiencing DNS-related connectivity issues. Normal DNS cache auto-expires based on TTL values (typically 300–86400 seconds). Flushing too frequently just slows down your browsing since every lookup needs a fresh query.
Does clearing DNS cache affect browsing speed?
Temporarily, yes. After flushing, your computer must re-resolve every domain from scratch, adding 20–100ms per new lookup until the cache rebuilds. This is only noticeable for the first few minutes of browsing after a flush. The cache rebuilds naturally as you visit sites.
Can I clear ISP-level DNS cache?
No — you cannot clear your internet provider's DNS resolver cache. ISP resolvers cache records based on the TTL set by the domain's authoritative nameservers. If you need to bypass ISP caching quickly, switch your DNS to a public resolver like Google (8.8.8.8) or Cloudflare (1.1.1.1) in your network settings. Alternatively, use our DNS Record Lookup which always queries Google's DNS directly and returns fresh results.
Does flushing DNS cache fix "DNS_PROBE_FINISHED_NXDOMAIN" errors?
Sometimes. The DNS_PROBE_FINISHED_NXDOMAIN error means the DNS resolver returned "domain doesn't exist." If this error appears for a site you know exists, flushing the DNS cache and restarting your browser can resolve it. If it persists, try switching your DNS server (to 8.8.8.8 or 1.1.1.1) or check if the site is actually down using our DNS Record Lookup.
What's the difference between DNS cache and browser cache?
DNS cache maps domain names to IP addresses (e.g., example.com → 93.184.216.34). Browser cache stores web content (HTML, CSS, JavaScript, images) so pages load faster on repeat visits. Clearing one doesn't clear the other. For DNS-related issues, flush DNS cache. For stale page content after a site update, clear browser cache.
Can DNS caching cause security issues?
In rare cases, yes. DNS cache poisoning (or DNS spoofing) is an attack where malicious DNS data is injected into a resolver's cache, redirecting users to fraudulent sites. Modern DNS resolvers use DNSSEC to cryptographically verify responses and prevent poisoning. Flushing DNS cache is a mitigation step if you suspect cache poisoning. For more on DNS security, see our DNS Record Types guide which covers DNSSEC (covered in DNSKEY, DS, and RRSIG record sections).