Your computer keeps a short-term memory of DNS answers so it does not have to ask again for every page. Right after a change, such as a site moving to a new server, that memory can keep sending you to the old place. Flushing the cache makes your computer ask again. It is safe and takes seconds.
Flushing only clears your computer. Your router and internet provider keep their own caches and let go when the record’s TTL runs out. If a change still has not reached you after flushing, waiting is usually the only fix. See DNS propagation.
Windows 10 and 11
- Open the Start menu, type
cmdand open Command Prompt. Administrator rights are not needed. - Run the command below. Windows replies Successfully flushed the DNS Resolver Cache.
ipconfig /flushdns
In PowerShell, the equivalent is Clear-DnsClientCache. To see what Windows has cached, run ipconfig /displaydns.
macOS
Open Terminal and run the line below. It asks for your password and prints nothing when it succeeds. It works on every release from El Capitan (10.11) onwards.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux
What to run depends on which service, if any, is caching.
systemd-resolved (Ubuntu, Debian 12 and newer, Fedora)
sudo resolvectl flush-caches
resolvectl statistics
Current Cache Size in the second command should read 0. On older releases the first command is sudo systemd-resolve --flush-caches.
dnsmasq or nscd
Neither has a flush command; restarting the service empties its cache:
sudo systemctl restart dnsmasq
sudo systemctl restart nscd
If none of these is running, your system is not caching DNS and there is nothing to flush. Many server installs, including AlmaLinux and Rocky Linux by default, are in this group.
iPhone and iPad
iOS has no flush command. Either of these clears its cache:
- Turn Airplane Mode on, wait ten seconds, and turn it off.
- Or restart the device.
If you set a custom DNS server or a VPN profile, it may still answer from its own cache; switching it off and on clears that too.
Android
Android also has no flush command for the system cache. Toggle Airplane mode on and off, or restart the phone. If Private DNS is set under Settings > Network & internet, that resolver keeps its own cache, which you cannot clear from the phone. Chrome on Android has its own cache: clear it at chrome://net-internals/#dns as on a computer.
Your router
Most home routers cache DNS for every device on the network. Restarting the router clears it. If your router’s settings let you choose its DNS servers, it is often worth setting public resolvers such as 1.1.1.1 and 8.8.8.8, which are usually faster and more up to date than an internet provider’s.
Browsers keep their own cache
- Chrome and Edge: open
chrome://net-internals/#dns(oredge://net-internals/#dns) and press Clear host cache. Then open#socketson the same page and press Flush socket pools. - Firefox: open
about:networking#dnsand press Clear DNS Cache. - Safari: uses the macOS cache, so the Terminal command covers it.
Check what the world sees
nslookup example.com 1.1.1.1
dig example.com @8.8.8.8 +short
If public resolvers show the new address and your machine does not, flushing is the fix. If they also show the old one, the change has not spread yet.
When to flush
- After changing a domain’s DNS records and you still see the old site.
- When one site fails with DNS_PROBE_FINISHED_NXDOMAIN but works on other devices.
- After editing your
hostsfile, so the change takes effect immediately. - After switching VPNs or DNS settings.
Flushing is harmless. The only effect is that the next visit to each site does a fresh lookup, which takes a few milliseconds.
Related
Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.



