How to Flush the DNS Cache on Windows, Mac, Browsers, Phones and the Router
Contents
Your computer remembers the addresses of websites it has looked up, so it does not have to ask a DNS server every time. Usually that makes browsing faster. But when a site moves to a new server, or a lookup failed once, the stale answer can stick around — and the site will not open on your device while it works everywhere else. Flushing the DNS cache throws those remembered answers away. Here is how to do it everywhere the cache lives.
What the DNS Cache Is
DNS turns names such as example.com into IP addresses. Answers are cached at several levels, each for a time set by the site’s DNS records:
- in the browser (Chrome, Edge and Firefox keep their own cache);
- in the operating system;
- in the router, if it acts as the DNS server for your network;
- at your DNS provider — your internet provider or a public service such as Google Public DNS or Cloudflare.
A stale entry can sit at any of these levels, so it is worth clearing the one closest to you first and working outwards.
When Flushing Helps
- A website moved or changed its address, and it works on mobile data but not on your Wi-Fi or computer.
- You changed DNS servers — see best DNS server — or edited the hosts file, and want the change to take effect immediately.
- Errors such as “DNS_PROBE_FINISHED_NXDOMAIN” appear for a site that exists.
- After fixing a DNS server not responding problem, to remove failed lookups.
Flushing does not make the internet faster and does not fix a DNS server that is down. Regularly flushing “for speed” has no benefit.
Windows
Open Command Prompt (search for cmd) and run:
ipconfig /flushdns
Microsoft’s command reference describes /flushdns as flushing and resetting the contents of the DNS client resolver cache. Windows confirms with “Successfully flushed the DNS Resolver Cache.” On Windows 10 and 11 this works in a normal Command Prompt; if you get an access error, open it with “Run as administrator”.
To see what is cached before you clear it, run ipconfig /displaydns.
Mac
Open Terminal and run:
sudo killall -HUP mDNSResponder
Enter your Mac password when asked (nothing appears while you type). This is the command Apple’s support article gives for OS X 10.10.4 and later, and it still applies to current macOS. Many guides combine it with sudo dscacheutil -flushcache, which Apple listed for older versions; running both does no harm. Restarting the Mac also clears the cache.
Chrome, Edge and Firefox
Browsers keep their own cache, so clearing the system cache alone may not be enough.
Google Chrome: type chrome://net-internals/#dns in the address bar and click Clear host cache — the step Google’s own support pages give for sites that will not open. Then close and reopen the tab.
Microsoft Edge and other Chromium-based browsers have the same page at edge://net-internals/#dns (or with their own prefix).
Firefox: type about:networking#dns in the address bar and click Clear DNS Cache.
If the browser uses secure DNS (DNS over HTTPS), it asks its own DNS provider directly; the steps above still clear the browser’s cache.
iPhone and Android
Phones have no command for it, but these do the same:
- Turn airplane mode on and off. Reconnecting the network clears cached lookups on most phones.
- Restart the phone if that does not help.
- Chrome on Android has the same
chrome://net-internals/#dnspage as on a computer. - On an iPhone, forget the Wi-Fi network and join it again to reset its network settings for that network.
The Router and Public DNS
The router. Many routers answer DNS requests for the whole network and keep their own cache. Restarting the router clears it; see how to reboot your router.
Public DNS services. If you use Google Public DNS (8.8.8.8), it has a Flush Cache page where you can ask it to refresh the cached answer for a specific domain. Cloudflare’s 1.1.1.1 has a similar purge page. This helps when a site owner has just changed DNS records and wants the change visible quickly. If you use your provider’s DNS, you have to wait for the cache to expire; switching to a public DNS server is the quick way around it.
Frequently asked questions
What does ipconfig /flushdns do?
It clears the DNS client cache in Windows, so the next lookup for each site goes to the DNS server again.
Is it safe to flush the DNS cache?
Yes. It only removes remembered lookups. The first visit to each site afterwards may take a fraction of a second longer.
How do I flush DNS on Windows 11?
Open Command Prompt and run ipconfig /flushdns. If you get an access error, open Command Prompt as administrator.
How do I flush DNS on a Mac?
Run sudo killall -HUP mDNSResponder in Terminal and enter your password.
Why does a site still not open after flushing DNS?
The browser may have its own cache, the router or DNS provider may still hold the old answer, or the problem is not DNS at all. Clear the browser cache, restart the router, and try a different DNS server.
Sources
- ipconfig command reference — Microsoft Learn
- Reset the DNS cache in OS X — Apple Support (archived)
- Fix hardware and system problems — Google Chromebook Help
- Flush Cache — Google Public DNS