How to Flush the DNS Cache on Windows, macOS, Linux, Browsers and Phones
You changed a DNS record, but your computer still opens the old site — or a site works for everyone except you. Somewhere between you and the domain, an old answer is cached. Flushing clears the caches on your own devices; this guide has the command for each one, and explains what to do when that is not enough.
Where DNS answers are cached
Each layer keeps an answer until its TTL runs out. You can clear the first three yourself. The resolver's cache belongs to your internet provider or to the public DNS you use; its entry expires on its own, and some public resolvers let you request an early refresh.
Windows 10 and 11
Open Command Prompt or PowerShell and run:
ipconfig /flushdns
:: or, in PowerShell:
Clear-DnsClientCacheYou should see "Successfully flushed the DNS Resolver Cache". If you get "access denied", open the terminal with Run as administrator. Then close and reopen the browser, which keeps its own cache.
macOS
Open Terminal and run this line, then enter your password. There is no confirmation message; no output means it worked. The same command works on every macOS version of the last decade.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderLinux
Most desktop distributions cache through systemd-resolved. Servers may use nscd or dnsmasq instead, or no cache at all:
# systemd-resolved (Ubuntu, Fedora, Debian 12+ and most desktops)
resolvectl flush-caches
resolvectl statistics # "Current Cache Size" should drop to 0
# nscd
sudo nscd -i hosts
# dnsmasq
sudo systemctl restart dnsmasqChrome, Edge, Brave and Firefox
Browsers keep a short DNS cache of their own. Paste the address into the address bar and press the button:
chrome://net-internals/#dns → Clear host cache (Chrome, Brave)
edge://net-internals/#dns → Clear host cache (Edge)
about:networking#dns → Clear DNS Cache (Firefox)Android and iPhone
- Quickest on both: switch Airplane mode on for ten seconds, then off. Reconnecting clears the system DNS cache.
- Android, Chrome:
chrome://net-internals/#dnsworks on Android too. - Android with Private DNS (Settings → Network → Private DNS): answers come from that DNS-over-TLS provider, so its cache applies, not your Wi-Fi's.
- iPhone and iPad: if Airplane mode is not enough, restart the device.
Your router and your resolver
Home routers often forward DNS and cache answers. Restarting the router clears that. The resolver behind it is out of your hands, with two exceptions:
- Google Public DNS (
8.8.8.8) has a Flush cache page for a single name and record type. - Cloudflare (
1.1.1.1) has a Purge cache page that does the same. - For your provider's own DNS, you can only wait for the TTL — or temporarily switch your device to a public resolver.
When flushing will not help
- The record was never changed. Check what the domain's own nameservers answer, for example with the PixDNS propagation checker. If they still give the old value, the change was not saved or was made at the wrong provider.
- The name did not exist a moment ago. Resolvers also cache "no such name" (NXDOMAIN), for the time set in the zone's SOA record — often an hour.
- A hosts file entry overrides DNS entirely, on that one machine:
# a forgotten line in the hosts file beats every cache:
# Windows: C:\Windows\System32\drivers\etc\hosts
# macOS/Linux: /etc/hosts
203.0.113.80 example.comFrequently asked questions
Is it safe to flush the DNS cache?
Yes. The cache refills itself with the next lookups; the only cost is that the first visit to each site takes a few milliseconds longer.
Do I need to restart after flushing?
No. Restart the browser, though, because it keeps its own cache and open connections.
Why do I still see the old site after flushing?
Usually because the resolver (your provider or a public DNS) still has the old answer cached until its TTL expires, or because the record at the domain's nameservers was not actually changed.
How often should I flush my DNS?
Only when something is wrong. There is no maintenance benefit to doing it regularly.
See the theory in practice — run a DNS Propagation Checker for your own domain.
Updated October 13, 2026