Skip to content
← All articles

How to Flush DNS Cache: Windows, Mac, Linux, Browsers

How to Flush DNS Cache: Windows, Mac, Linux, Browsers

DNS caching speeds up the internet — the OS and browser remember resolver answers and skip repeated lookups. But when a site changes IP, NS migrate, or availability breaks, a stale cache becomes a problem: users keep hitting the old address. This guide covers step-by-step commands for every platform and browser.

When you need to flush the DNS cache

How DNS cache is layered

Browser cache
Chrome, Firefox, Safari — their own DNS cache, about 60 seconds.
OS cache
Windows DNS Client, systemd-resolved on Linux, mDNSResponder on macOS.
Router cache
Most home routers cache DNS for all devices.
ISP / public resolver cache
You can't control it — expires by TTL.

Windows (10, 11)

Open Command Prompt or PowerShell as Administrator:

ipconfig /flushdns

Successfully flushed the DNS Resolver Cache means it worked. View cache contents:

ipconfig /displaydns

Restart the DNS Client service:

net stop dnscache
net start dnscache

macOS

All versions from Monterey upward:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Ventura and Sonoma may also need:

sudo killall -HUP mDNSResponderHelper

Linux

Depends on your DNS service:

systemd-resolved (Ubuntu 18.04+, Debian 12+, Fedora)

sudo systemd-resolve --flush-caches
# or newer:
sudo resolvectl flush-caches
sudo resolvectl statistics

nscd

sudo systemctl restart nscd
# or
sudo /etc/init.d/nscd restart

dnsmasq

sudo systemctl restart dnsmasq

Browsers

Chrome / Edge / Opera (Chromium)

Open chrome://net-internals/#dns and click "Clear host cache". Also chrome://net-internals/#sockets and "Flush socket pools".

Firefox

Go to about:networking#dns and "Clear DNS Cache". Or disable internal DNS cache via about:config and network.dnsCacheEntries = 0.

Safari

Safari uses the system mDNSResponder — flush via macOS commands above.

Mobile

Android

Toggle Airplane mode — clears most of the cache. Or reboot the device. In Chrome: chrome://net-internals/#dns.

iOS

Airplane mode on/off clears Wi-Fi cache. Full reset: Settings, General, Reset, Reset Network Settings (also wipes saved Wi-Fi).

Routers

If flushing on all devices doesn't help, suspect the router. Open its web UI (usually 192.168.1.1 or 192.168.0.1) and:

Verify the cache is flushed

Open DNS Lookup and compare with local dig:

dig A example.com +short               # via system resolver
dig A example.com @1.1.1.1 +short     # directly from public

If answers match and point to the current IP — cache is clean.

Why flushing sometimes doesn't help

  1. Stale ISP cache. Your OS asks the ISP resolver, which also caches. Switch to 1.1.1.1.
  2. Change didn't land in the authoritative zone. Verify with dig +trace.
  3. HSTS preload. If the domain is on the preload list, SSL/TLS проверку is forced — the old connection may stick.
  4. Hosts file overrides. Check /etc/hosts (Windows: C:\Windows\System32\drivers\etc\hosts).

FAQ

Is flushing the DNS cache dangerous?
No. Worst case: the first site load is slightly slower (50-200 ms).
Do I need to reboot after flushdns?
No, it takes effect immediately.
Chrome doesn't open chrome://net-internals/#dns
Newer Chrome moves the page to chrome://net-export. Alternative: clear cache via Settings.
Does VPN affect DNS cache?
VPNs typically override the DNS resolver. Disable the VPN and retest.

Conclusion

Flushing the DNS cache is the first step in any DNS debugging session. Learn the command for your OS, and whenever a stale cache is suspected, compare via DNS Lookup and Propagation Checker. If the issue recurs, set up DNS monitoring so you hear about changes before your users do.

Check your website right now

Check now →
More articles: DNS
DNS
DNS Failover: Automatic Traffic Switching for High Availability
16.03.2026 · 62 views
DNS
DNS Propagation: Why DNS Changes Don't Take Effect Instantly
11.03.2026 · 44 views
DNS
DNS Record Types: A, AAAA, MX, CNAME, TXT and More
10.03.2025 · 39 views
DNS
DNS TTL Guide: Optimal Values for Every Record Type
16.03.2026 · 37 views