← All Tools

How to Clear DNS Cache

Step-by-step commands to flush DNS cache on macOS, Windows, Linux, browsers, and routers — plus how to verify the flush worked.

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:

  1. Browser cache — Chrome, Firefox, Edge each maintain their own DNS cache (typically 1–2 minutes)
  2. OS cache — macOS, Windows, and Linux each have a system-level DNS resolver cache
  3. Router cache — Your home/office router often runs a DNS proxy with its own cache
  4. 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

Flush DNS cache:
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

Same command:
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.

Verify DNS cache was flushed (macOS):
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

Flush DNS cache:
ipconfig /flushdns

You should see: Successfully flushed the DNS Resolver Cache.

Additional Windows DNS Commands

View current DNS cache:
ipconfig /displaydns
Reset all network settings (nuclear option):
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)

Flush DNS cache:
sudo resolvectl flush-caches
Check cache statistics:
sudo resolvectl statistics

If resolvectl isn't found, try the older command name: sudo systemd-resolve --flush-caches.

Linux nscd (Name Service Cache Daemon)

Restart nscd to clear all caches:
sudo service nscd restart
# or
sudo systemctl restart nscd
Flush only DNS cache (not passwd/group):
sudo nscd -i hosts

Linux dnsmasq (common on servers & routers)

Restart dnsmasq:
sudo systemctl restart dnsmasq
Clear cache without restart:
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

  1. Open chrome://net-internals/#dns
  2. Click "Clear host cache"
  3. 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

  1. Open about:networking#dns
  2. Click "Clear DNS Cache"

Firefox's DNS cache TTL is 60 seconds by default, so it usually clears faster than Chrome's.

Edge

  1. Open edge://net-internals/#dns
  2. 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:

  1. Menu bar → DevelopEmpty Caches (Cmd+Option+E)
  2. 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

  1. Power-cycle: Unplug the router, wait 30 seconds, plug it back in. This is the simplest method and works for all consumer routers.
  2. Admin panel: Log into your router's admin page (typically 192.168.1.1 or 192.168.0.1), find the DNS or Advanced settings section, and look for "Flush DNS" or "Clear DNS Cache".
  3. 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)

macOS / Linux:
dig example.com A +short
Windows:
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:

Troubleshooting: Flush Didn't Work

You ran the flush command but still see old DNS results. Here's what to check, in order:

  1. 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.
  2. Your router is caching. If multiple devices on the same network see old results, power-cycle the router.
  3. 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 minimum TTL field to see how long other resolvers will cache the old value. Use our DNS Record Lookup and select "SOA" to check.
  4. You're checking the wrong domain. Verify you're querying the exact domain you changed — www.example.com and example.com are separate DNS records with separate caches.
  5. 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).