How to Clear DNS Cache in Windows
Imagine you move to a new house, but a few friends keep mailing things to your old address because that’s what they have written down. Nothing is wrong with the mail system. The information they’re using is just out of date.
That’s roughly what happens when your computer’s DNS cache goes stale. A website moves to a new server, but your PC keeps heading to the old address, and you get a page that won’t load, an error message, or an outdated version of the site. Clearing the cache makes your computer forget what it wrote down so it can look things up fresh.
The quick answer: open Command Prompt as an administrator, type ipconfig /flushdns, and press Enter. That’s it. The rest of this guide covers other ways to do it, how to peek inside the cache, and what to try if the problem sticks around.
What Your DNS Cache Actually Does
Every time you visit a website, your computer needs to turn a name like example.com into a numeric address. That lookup is called DNS. To save time, Windows keeps a short-term memory of recent lookups, so it doesn’t need to ask again each time.
Normally, this works wonderfully and you never think about it. The trouble starts when a saved entry is wrong, expired, or corrupted. Typical signs include a site that won’t load while others work fine, an error like “DNS_PROBE_FINISHED_NXDOMAIN,” or a website that seems to point to an old version after its owner made changes. Flushing the cache is a harmless first step for all of these.
Error Messages That Point to a DNS Problem
Not every connection problem is about DNS, but some error messages are strong hints. In Chrome and Edge, these are the most common:
- DNS_PROBE_FINISHED_NXDOMAIN means the name couldn’t be matched to an address. The site may not exist, but a stale cache entry or a typo can cause it too.
- ERR_NAME_NOT_RESOLVED is a similar message, suggesting your browser couldn’t turn the name into an address.
- DNS_PROBE_FINISHED_NO_INTERNET usually means the problem is your connection rather than the cache, so check your Wi-Fi or cable first.
- DNS_PROBE_FINISHED_BAD_CONFIG points to a settings problem, such as a wrong DNS server entry or a firewall interfering.

If you see one of the first two on a site you know works, flushing the cache is a sensible first move. Double-check the spelling of the address as well, since a typo produces the same error.
How to Tell Whether It’s Really DNS
Before you start clearing things, a two minute test can tell you if DNS is the problem or if your internet is actually down. Open Command Prompt and try these in order.
First, type ping 8.8.8.8. That’s a well known public address, so no name lookup is needed. If you get replies, your internet connection works. Next, type ping google.com. If the first test succeeds but this one fails, or says it couldn’t find the host, DNS is likely the issue, and flushing the cache is a good next step.

For a closer look, type nslookup example.com. It shows which DNS server answered and what address it gave back. A message about a non existent domain, or a server that doesn’t respond, tells you the lookup itself is failing. If both pings fail, the problem is your connection, not your DNS cache, so check your router, cable, or Wi-Fi.
The Standard Way: Command Prompt
This is the method most people use, and it takes about ten seconds.
- Click Start and type cmd.
- Right click Command Prompt and choose Run as administrator. (On Windows 11, you can also right click the Start button and choose Terminal (Admin).)
- Type the following and press Enter:
ipconfig /flushdns

You should see a message saying the DNS Resolver Cache was successfully flushed. If you instead see an error about the function failing, you most likely forgot to run Command Prompt as an administrator. Close it and try again with elevated permissions.
The PowerShell Way
If you prefer PowerShell, there’s a command that does the same job. Open PowerShell as an administrator and run:
Clear-DnsClientCache

It doesn’t print a confirmation, so the lack of a message doesn’t mean it failed. The result is identical to the command above, so use whichever feels more comfortable.
Peek Inside the Cache Before You Clear It
If you’re curious, or you want to confirm that a bad entry is really there, you can look at what’s stored. In Command Prompt, run:
ipconfig /displaydns

You’ll see a long list of recently looked up names and the addresses they’re tied to. In PowerShell, Get-DnsClientCache does something similar in a tidier table. Beyond troubleshooting, it’s a small eye opener about how much your computer remembers, because the list reveals many of the sites you’ve visited recently. That’s one reason people flush it for privacy too.
Don’t Forget Your Browser
Browsers keep their own small DNS cache, separate from Windows. If you’ve flushed Windows and a site still misbehaves, try clearing the browser’s too.

In Chrome, type chrome://net-internals/#dns in the address bar and click Clear host cache. In Edge, use edge://net-internals/#dns. These internal pages change from time to time, so if the button isn’t there in your version, restarting the browser completely does a similar job. Also close every window, not only the one you were using.
When Flushing Isn’t Enough
If the problem remains after you’ve cleared the cache, the culprit might be somewhere else. Here’s where to look next:

- The hosts file. This is a text file Windows checks before it asks DNS anything. If an entry in it points a website to the wrong place, it overrides everything. You’ll find it at
C:\Windows\System32\drivers\etc\hosts. Open it in Notepad as an administrator, and look for lines that don’t start with a # symbol. Unless you added something on purpose, the file should be mostly empty comments. - Your router. Routers keep a DNS cache too. Restarting yours, by unplugging it for around 30 seconds, clears it.
- Your DNS server. If your internet provider’s DNS server is slow or returning bad answers, switching to a different public DNS provider in your network settings can fix it.
- A deeper network reset. As a last resort, open Command Prompt as an administrator and run
netsh winsock resetfollowed bynetsh int ip reset, then restart your PC. This resets core networking components, so save your work first.
Is It Safe? Any Downsides?
Clearing the DNS cache is safe. It doesn’t delete files, settings, passwords, or anything personal. The only side effect is that the first visit to each website afterward may take a split second longer, because your PC has to look the address up again. The cache rebuilds itself as you browse, so you’ll barely notice.
Make It a One Click Shortcut
If you find yourself doing this often, such as when you work with websites or test changes, you can save time with a shortcut. Create a new text file, type ipconfig /flushdns on the first line and pause on the second, and save it with a .bat extension. Right-click the file and choose Run as administrator whenever you want to clear the cache. You can also pin it for quick access.
Clearing DNS Cache on Other Devices
If a website acts up on your phone or Mac but works on your PC, the stale entry is on that device. The steps differ a bit by system.
On a Mac, open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. It will ask for your password, and it doesn’t show a confirmation message when it finishes.
On an Android phone or iPhone, there’s no single DNS flush button. The simplest fix is to turn on airplane mode for about 10 seconds and turn it off again, or restart the phone. On Android, clearing Chrome’s cache and data can also help for browser-specific problems.
On a Chromebook, open Chrome and visit chrome://net-internals/#dns, then clear the host cache, the same way you would in Chrome on Windows.

If every device on your network has the same problem, the cause is probably your router or your DNS provider, so restarting the router is the best place to begin.
Quick Answers
What does flushing DNS do?
It clears the saved website address lookups stored on your computer, so Windows has to ask for fresh, current information the next time you visit a site.
Do I need administrator rights to clear the DNS cache?
Yes. Command Prompt and PowerShell both need to be run as an administrator for the command to work.
How often should I clear my DNS cache?
Only when you need to, such as when a site won’t load, shows an old version, or after you change DNS settings. There’s no need to do it on a schedule.
Will clearing the DNS cache speed up my internet?
Not in general. It fixes lookup problems caused by outdated entries, but it won’t increase your connection speed.