How to Flush DNS Cache on Windows, Mac, Linux, and Chrome
Short answer: To flush your DNS cache, run ipconfig /flushdns in Windows Command Prompt or PowerShell, sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in macOS Terminal, or sudo resolvectl flush-caches on Linux systems using systemd-resolved. To clear the browser's own copy, open chrome://net-internals/#dns and click Clear host cache. Flushing only removes locally stored name-to-IP answers. It does not clear history, cookies, or passwords.
Flushing DNS is the fastest fix when a website won't load after its address changed, or when you see errors like DNS_PROBE_FINISHED_NXDOMAIN or This site can't be reached for a site you know is up. Your computer keeps a local copy of each name-to-IP answer it has looked up so it doesn't have to ask a resolver again. That copy can go stale. Clearing it forces the next lookup to go out fresh.
Before you start
- Check that the site is actually up. Load it from your phone on cellular data, or use the WhereIsDNS lookup tool to see what the public internet currently resolves the name to.
- A flush only fixes a stale answer stored on your device. If the problem is at your router, your ISP, or the site's own DNS, flushing won't help. See when flushing won't fix it.
- You may need administrator rights on macOS and Linux (the commands below use
sudo). Windows doesn't require admin foripconfig /flushdns.
Quick reference
| Platform | Command or action | Where to run it |
|---|---|---|
| Windows 10 and 11 | ipconfig /flushdns | Command Prompt or PowerShell |
| macOS (current versions) | sudo dscacheutil -flushcache then sudo killall -HUP mDNSResponder | Terminal |
| Linux, systemd-resolved | sudo resolvectl flush-caches | Terminal |
| Linux, nscd | sudo nscd -i hosts (or sudo systemctl restart nscd) | Terminal |
| Chrome | Clear host cache | chrome://net-internals/#dns |
| Edge | Clear host cache | edge://net-internals/#dns |
| Firefox | Clear DNS Cache | about:networking#dns |
How to flush DNS on Windows
- Open Start, type
cmdorPowerShell, and open it. - Run:
ipconfig /flushdns - A successful flush prints: Successfully flushed the DNS Resolver Cache.
To confirm the cache is empty, run ipconfig /displaydns. It should list few or no entries.
How to flush DNS on Mac
Modern macOS keeps its resolver cache in a service called mDNSResponder. A full flush takes two commands, and you need your administrator password.
- Open Terminal (Applications → Utilities → Terminal).
- Run:
sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder - Enter your password when prompted. A successful run prints nothing. If you see
No matching processes were found, thekillallstep found no runningmDNSResponderprocess under that name; the first command still ran.
Some older guides list only the first command. On current macOS, run both for a full flush.
How to flush DNS on Linux
The command depends on which resolver your distribution uses.
systemd-resolved (Ubuntu, Fedora, and most recent desktop distributions):
sudo resolvectl flush-cachesSystems on systemd 239 or earlier use sudo systemd-resolve --flush-caches.
nscd (Name Service Cache Daemon):
sudo nscd -i hostsIf that isn't available, restart the service: sudo systemctl restart nscd.
dnsmasq: restart it to clear its cache: sudo systemctl restart dnsmasq.
Not sure which one you have? Run resolvectl status. If it prints output, you're on systemd-resolved. If the command isn't found, check systemctl status nscd and systemctl status dnsmasq.
How to clear the DNS cache in your browser
Browsers keep their own DNS cache, separate from the operating system's. If the OS flush doesn't help, clear the browser too.
- Chrome: go to
chrome://net-internals/#dnsand click Clear host cache. Optionally, openchrome://net-internals/#socketsand click Flush socket pools to drop open connections that may still point at the old address. - Edge: go to
edge://net-internals/#dnsand click Clear host cache. - Firefox: go to
about:networking#dnsand click Clear DNS Cache.
These pages are for troubleshooting. Don't change other settings on them unless you know what they do.
How to flush DNS on iPhone and Android
Neither iOS nor Android offers a direct DNS cache flush. Two practical options:
- Toggle Airplane Mode on, wait a few seconds, then turn it off. This resets the active network connection, which often forces fresh lookups, but it doesn't guarantee a cache clear.
- Switch the DNS resolver (for example, to
1.1.1.1or8.8.8.8) in your Wi-Fi network settings. A different resolver has a different cache.
When flushing won't fix it
A flush removes only the copy stored on your device. A stale answer can also live in:
- Your router, which may run its own DNS forwarder. Restart the router or change its DNS settings.
- Your ISP's resolver, or a public resolver such as Google or Cloudflare. You usually can't flush these on demand. Some public resolvers offer cache-purge tools, but they only clear their own cache. Otherwise each cached answer expires when its TTL runs out.
- The authoritative DNS. If you recently changed a record, the new value may still be propagating. Check it with the WhereIsDNS propagation checker to see what different resolvers return.
TTL matters. A record's time-to-live (TTL) sets how long resolvers may cache it. If the old record had a TTL of 86,400 seconds (24 hours), some resolvers may keep the old answer for up to a day, no matter what you flush locally. Lowering the TTL before a planned change shortens that window.
How to check the flush worked
- Windows:
ipconfig /displaydnsshows cached entries. After a flush, the list should be short. - Any OS: query the name directly against a public resolver to see what the internet currently returns:
nslookup example.com 1.1.1.1
On macOS and Linux, dig example.com gives the same answer, plus the TTL. Compare the answer with what your browser loads.
If the public answer is correct and your browser still fails, clear the browser cache as described above.
Does flushing DNS speed up my internet?
Not in general. A DNS flush forces a new lookup, which takes a moment. It only helps when a stale or wrong answer is the cause. If pages are slow across the board, look at your connection, Wi-Fi signal, or a resolver that's slow to respond.
Frequently asked questions
Is it safe to flush DNS?
Yes. It removes only locally stored name-to-IP answers. It doesn't delete browsing history, saved passwords, or cookies, and it doesn't change your settings.
How often should I flush DNS?
Only when you need to: after a site moves to a new server, after you change DNS records, or when a name stops resolving. There's no need to flush on a schedule.
Why does ipconfig /flushdns say it succeeded but the site still fails?
The stale answer is probably cached somewhere else: in your browser, your router, or your ISP's resolver. It can also be a real propagation delay. Work through the browser step and the router step above.
Do I need to restart my computer after flushing?
No. A flush takes effect immediately. A restart also clears the cache, but it's slower.
Does flushing DNS fix a DNS leak?
No. A flush clears old answers. It doesn't change which resolver your device uses. To check which resolver your lookups reach, run the DNS leak test.
Can flushing DNS fix "DNS_PROBE_FINISHED_NXDOMAIN"?
Sometimes. That error means Chrome couldn't resolve the name. If the site works on your phone, flush your computer's DNS and Chrome's host cache. If it still fails, the name may not exist yet or may point to a server that's down.
Related guides
- DNS records, explained: what A, AAAA, CNAME, MX, and TXT records do, and how their TTLs work.
- DNS glossary: plain-language definitions of resolver, TTL, cache, and propagation.