How to Flush DNS Cache on Windows, Mac, Linux and Phone
Your device keeps a short-term memory of recent DNS answers so pages load faster. When a website moves to a new server, or a lookup goes wrong, that memory can hold a stale answer and send you to the wrong place. Flushing the DNS cache clears it and forces a fresh lookup. Here is the exact command or step for every device.
When flushing actually helps
- A site you just moved or updated still points to the old server.
- You see “server not found” or “this site can't be reached” for a site that works elsewhere.
- You changed your DNS provider and want the change to take effect now.
- A blocked or redirected page keeps coming back after the block was lifted.
It will not speed up a slow connection or fix a problem on the website's end. For that, see how to fix slow DNS lookups.
Windows 11 and Windows 10
- Press the Windows key, type
cmd, then choose Run as administrator. - Run this command:
ipconfig /flushdns
You should see “Successfully flushed the DNS Resolver Cache”. PowerShell has an equivalent, Clear-DnsClientCache. To see what is in the cache before you clear it, run ipconfig /displaydns.
macOS
Open Terminal and run both parts of this line together, then enter your password:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
The first part clears the directory service cache and the second restarts the service that actually answers DNS queries. Running only one of them often leaves the stale entry in place. There is no confirmation message, which is normal.
Linux
It depends on which resolver your distribution uses:
- systemd-resolved (Ubuntu, Fedora and most modern distributions):
resolvectl flush-caches. On older releases,sudo systemd-resolve --flush-caches. - nscd:
sudo systemctl restart nscd - dnsmasq:
sudo systemctl restart dnsmasq
Many minimal Linux setups cache nothing at all, in which case there is nothing to flush.
Google Chrome
Chrome keeps its own cache, separate from the operating system. Type chrome://net-internals/#dns into the address bar and click Clear host cache. Then open chrome://net-internals/#sockets and click Flush socket pools, because Chrome may otherwise reuse an existing connection. Edge, Brave and other Chromium browsers use the same addresses.
Android
Android has no built-in flush command. In order of effort:
- Turn airplane mode on, wait five seconds, turn it off. This resets the network stack and is enough most of the time.
- Restart the phone.
- In Chrome, clear the host cache at
chrome://net-internals/#dns. - Forget the Wi-Fi network and reconnect.
iPhone and iPad
There is no command here either. Toggle airplane mode on and off, or restart the device. If the problem persists, go to Settings, then General, then Transfer or Reset iPhone, then Reset, then Reset Network Settings. That last option also clears saved Wi-Fi passwords, so use it only as a last resort.
Your router also caches
Most home routers run a small DNS forwarder with its own cache. If flushing every device does not help, restart the router. Find its address with how to find your router's IP address.
Check whether it worked
Look up the domain with our DNS lookup, which queries live resolvers rather than anything cached on your machine. Compare the answer with what your browser is doing. If the live answer is correct but your browser still goes elsewhere, something on your device is still caching. If the live answer itself is the old one, the change simply has not propagated yet, and the record's TTL tells you how long that takes. See DNS records explained.
Try it yourself
See the real numbers for your own connection with our free tools.