How-to
How to flush your DNS cache on any device
Last updated November 10, 2026
To flush your DNS cache, run ipconfig /flushdns on Windows, sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder on a Mac, or sudo resolvectl flush-caches on Linux. Chrome keeps its own cache, which you clear at chrome://net-internals/#dns. It takes a few seconds and needs no restart.
Flushing throws away the list of website addresses your device has memorized, so the next visit to each site starts with a fresh lookup. That is the fix when a site has moved and your computer keeps going to the old place. Below are the exact steps for every common system, how to check that the flush worked, and what to try when it did not help.
The commands at a glance
Pick your system, paste the command, press Enter. Each one is explained further down, and Windows, macOS and Linux have a full guide of their own.
Flush DNS commands by system
- Windows 11 and 10
- Command ipconfig /flushdns
- macOS
- Command sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Linux (systemd-resolved)
- Command sudo resolvectl flush-caches
- Chrome, Edge, Brave
- Command chrome://net-internals/#dns
- Firefox
- Command about:networking#dns
| System | Command |
|---|---|
| Windows 11 and 10 | ipconfig /flushdns |
| macOS | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Linux (systemd-resolved) | sudo resolvectl flush-caches |
| Chrome, Edge, Brave | chrome://net-internals/#dns |
| Firefox | about:networking#dns |
Phones and tablets have no command for this. On those, switching airplane mode on and off does the job (details below).
What the DNS cache is
Computers find each other by IP address, not by name. Before your browser
can open example.com, it has to ask a DNS resolver which address that name currently points to. The answer
comes back with an expiry time attached, called the TTL (time to live), and your device keeps the answer
until that time runs out. That store of remembered answers is the DNS cache. It saves a lookup on every repeat visit,
which is why it exists.
There is more than one cache between you and a website, and that matters when a flush seems to do nothing:
- Your browser. Chrome, Edge and Firefox remember addresses themselves, separately from the system.
- Your operating system. This is the cache the commands on this page clear.
- Your router. Most home routers answer repeat questions from their own memory.
- Your DNS resolver. Your internet provider's DNS server, or a public one such as Google's
8.8.8.8or Cloudflare's1.1.1.1, caches every answer for all of its users.
A stale address can sit in any of them. The system and browser caches are the two you control directly. For the other two, see router and public resolvers further down.
When flushing your DNS cache helps
A flush fixes one specific problem: your device is holding on to an answer that is no longer true. The typical signs:
- A website moved to a new server (or you changed its DNS records yourself) and you still land on the old one, or on nothing at all.
- One device shows
DNS_PROBE_FINISHED_NXDOMAIN,ERR_NAME_NOT_RESOLVEDor "server not found" while the same site opens fine on your phone. - You switched to a different DNS server and want every lookup to go through it from now on. (Our DNS speed test shows which resolver answers fastest from your connection.)
- You edited your hosts file and the change is being ignored.
- You removed malware or fixed a hijacked router setting and want to be sure no forged address is left behind.
- You share the computer. On Windows, anyone can list the cache and see which sites were looked up recently.
It will not help when the site is down for everyone, when the record is wrong at the source, or when your connection is slow. A flush never makes the internet faster. For a few seconds it makes it slightly slower, because every address has to be looked up again.
Not sure which case you have? Look the domain up with our DNS lookup. It shows what the name resolves to right now from outside your network, along with the TTL of each record. If that address is the new one and your computer still goes to the old one, your cache is the culprit.
Flush DNS on Windows
- Press
Win + R, typecmdand press Enter. - Type the command below and press Enter.
ipconfig /flushdns Windows confirms with "Successfully flushed the DNS Resolver Cache." The command is identical on Windows
11 and Windows 10. In PowerShell you can run Clear-DnsClientCache instead.
Flush DNS on a Mac
- Open Terminal: press
Cmd + Space, typeTerminaland press Return. - Paste the command below and press Return.
- Enter your Mac password when asked. Nothing appears on screen while you type, which is normal.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder There is no success message. If you get your prompt back without an error, the cache is empty. Every recent macOS release uses this command; older versions had different ones, all listed in the Mac guide.
Flush DNS on Linux
Linux has no single DNS cache. What you flush depends on which resolver service your distribution runs:
sudo resolvectl flush-caches That is the command for systemd-resolved, the default on Ubuntu, Fedora and Linux Mint. Systems with
dnsmasq use sudo killall -HUP dnsmasq, and those with nscd use sudo nscd -i hosts. Plenty of
machines (a stock Debian or Arch install, for example) cache nothing locally, in which case there is nothing to flush.
Clear the DNS cache in Chrome, Edge, Firefox and Safari
Browsers keep their own short-lived DNS cache, so a system flush alone is sometimes not enough. Clearing it takes two clicks:
- Chrome: open
chrome://net-internals/#dnsand click Clear host cache. Then switch tochrome://net-internals/#socketsand click Flush socket pools, which closes connections that are still open to the old address. - Edge, Brave, Opera, Vivaldi: the same page exists under each browser's own prefix, for example
edge://net-internals/#dnsorbrave://net-internals/#dns. - Firefox: open
about:networking#dnsand click Clear DNS Cache. - Safari: it has no cache button of its own and relies on macOS. Flush the system cache, then quit
Safari completely with
Cmd + Qand reopen it.
Quitting any browser completely and starting it again also empties its DNS cache. One more thing to know: if the browser has secure DNS (DNS over HTTPS) switched on, it sends its lookups straight to the configured DNS provider and skips the system cache. In that setup the browser's own cache is the one that counts.
Flush DNS on iPhone, iPad and Android
Phones have no flush command, but their DNS cache lives in memory and is cleared whenever the network connection is rebuilt. Work down this list and stop as soon as the problem is gone:
- Toggle airplane mode. Switch it on, wait about ten seconds, switch it off. This is enough in most cases.
- Restart the phone if that changed nothing.
- Reset the network settings as a last resort. On iPhone and iPad: Settings → General → Transfer or Reset iPhone → Reset → Reset Network Settings (the menu says iPad on an iPad). On Android: Settings → System → Reset options, then the Wi-Fi and mobile network reset (the wording differs by manufacturer). Be aware that this also forgets saved Wi-Fi passwords and paired Bluetooth devices.
Chrome on Android has the same chrome://net-internals/#dns page as on the desktop, so you can clear the
browser cache there without touching the rest of the phone.
Router and public resolver caches
If every device on your network gets the same outdated answer, the cache at fault is not on your device.
Your router. Unplug it for about 30 seconds and plug it back in. Its DNS cache lives in memory and does not survive a restart. If you would rather look at its settings first, find your router's IP address and open its admin page.
Your DNS resolver. You cannot flush your internet provider's DNS servers. You can only wait for the record's TTL to run out. The big public resolvers are friendlier and let anyone clear a single domain from their cache:
- Google Public DNS: Flush Cache
- Cloudflare 1.1.1.1: Purge Cache
- OpenDNS: CacheCheck
These tools are mostly of interest to site owners who have just changed a record and do not want to wait for the old one to expire everywhere.
Check that the flush worked
The quickest test is the obvious one: reload the page that was misbehaving. To check properly, compare what your device resolves with what the rest of the internet sees:
- Run
ping example.comin a terminal, with the affected domain in place ofexample.com. The first line shows the address your system currently uses for that name, cache included. - Look the same domain up with our DNS lookup, which asks from outside your network.
- If both show the same address, your DNS cache is fine and the problem lies elsewhere. Often it is the browser's page
cache: try a hard reload with
Ctrl + F5, orCmd + Shift + Ron a Mac. - If they still differ right after a flush, a cache further up the chain is serving the old record: your router or your DNS resolver.
One caveat: large sites behind a content delivery network hand out different addresses depending on where the question
comes from, so a mismatch for a site like google.com means nothing. The comparison is meaningful for ordinary
sites with one or two fixed addresses.
Frequently asked questions
What does flushing the DNS cache do?
It deletes the website addresses your device has remembered from earlier lookups. The next time you open a site, your device asks a DNS server for the current address instead of reusing the stored one. Nothing else is touched: bookmarks, passwords, history and files all stay as they are.
Is it safe to flush the DNS cache?
Yes. The cache only holds copies of public information that your device can fetch again in milliseconds. The worst side effect is that the first visit to each site afterwards takes a fraction of a second longer.
How often should I flush my DNS cache?
Only when something is wrong. Every entry expires by itself when its TTL runs out, usually within minutes or hours, so there is no benefit to flushing on a schedule.
Does flushing DNS make my internet faster?
No. It fixes wrong answers, not slow connections. Right after a flush, lookups are briefly slower because nothing is cached. If name lookups feel slow all the time, switching to a faster DNS resolver helps more than any flush.
Does restarting my computer flush the DNS cache?
Yes. Windows, macOS and Linux keep the DNS cache in memory, so it is empty after every restart. A restart does not clear the cache in your router or at your DNS provider, and it takes far longer than typing the command.
Does flushing DNS change my IP address?
No. Your IP address is assigned by your router and your internet provider and has nothing to do with the DNS cache. Flushing only affects how your device translates names into addresses.
Why do I still see the old website after flushing DNS?
Because another cache still has the old answer. Clear the browser's own DNS cache, do a hard reload to bypass cached page files, and restart the router. If the record was changed recently, your DNS provider may keep serving the old one until its TTL expires.