7 Ways to Flush DNS on Windows 11

If you’re experiencing connectivity issues, you may want to try flushing your DNS cache. Don’t worry, doing so doesn’t require any technical knowledge on your part and is quite easy to do.

Here’s everything you need to know about DNS cache and how to flush it on Windows 11 to improve the speed and performance of your internet connection.

What is a DNS cache?

Network instruments can only communicate with websites through their IP addresses. But no one wants to memorize IP addresses just to visit websites. This is where DNS comes in.

DNS (or Domain Name System) is an index of all available public websites and their IP addresses that help the network equipment access them without you having to memorize their addresses. 

Now, although there are various public DNS servers, Windows will still store a local copy of the index to speed up information about your recent and attempted visits to websites and other internet domains in a temporary database called DNS cache. Put simply, a DNS cache is a sort of a memory of the recent DNS searches for your computer to refer to whenever you’re trying to load a website.

When things are working well, it helps you to get to your web destination faster. But over time, this database can get corrupted which can slow down your network connection considerably. 

Related: 6 Ways to Update Drivers on Windows 11

What does flushing the DNS cache do?

As information in the DNS cache accumulates over time, it helps to speed up your internet navigation when visiting websites. But, websites don’t always remain the same. They change from time to time. This means that the information stored in the cache becomes obsolete and incorrect over time. Your computer has to sift through the information mess to find what works and what doesn’t, leading to slow internet access.

Flushing the DNS cache removes all this stored information. This forces the computer to look for DNS information for a website from scratch. Though, at first, you may find that visiting websites takes longer than expected. This is because after flushing the DNS cache, the computer is repopulating it with useful and relevant information. But as it does, your internet connection speeds should improve as well. 

DNS flush command

Well, the DNS Fluch command that is popularly used to flush the DNS on your Windows PC is ipconfig /flushdns that can be used both on the command line (CMD) and Run tools as given in the step-by-step guides below.

However, if you have a thing for Powershell, then you can use this flush DNS command Clear-DnsClientCache as is given below too. To find the detailed step-by-step guides for these commands, look right below. 

Related: How To Share Files and Folders on Windows 11

How to flush DNS cache on Windows 11 [7 ways]

Now, let’s take a look at the different methods by which you can flush this DNS cache on Windows 11.

Method 1: Using Command Prompt (CMD)

  1. Press the Start button first. Then type CMD to search for the command prompt. Now, click Run as administrator once you see it.
  2. Now, type the following command: ipconfig /flushdns
  3. Now hit the enter key to run the command. You will get a confirmation message that the DNS resolver cache has been flushed.

Method 2: Using PowerShell

Another way to flush the DNS cache on Windows 11 is to use PowerShell. Here’s how to do so:

  1. Press Start, type PowerShell, and click on Run as administrator.
  2. Now, type the following command: Clear-DnsClientCache
  3. Now hit the enter key to run the command.

And that’s it! This will clear your DNS cache instantly.

Method 3: Using RUN

You can also clear DNS cache straight from the RUN window without having to open any command terminal. Many people find this method much more convenient than the previous two options. Here’s how to do so:

  1. Press Win+R to open the RUN box. Now, simply type the following command: ipconfig /flushdns
  2. Now hit the enter key to run the command. You will see a command window for a split second and your DNS cache will be flushed. 

Method 4: Using a Batch file

If you plan to clear your DNS cache every so often, an easier way is to create a batch file that you can run by simply double-clicking on it. This is how to go about it:

  1. Press Start, type Notepad, and hit Enter.
  2. Then type the following in the text document: ipconfig /flushdns
  3. Then click on File in the top left corner.
  4. Select Save as.
  5. Click on the ‘Save as type’ drop-down menu and choose All files.
  6. Give your batch file a name and replace the .txt file extension with .bat.
  7. Click on Save.
  8. Now, anytime you need to clear the DNS cache, simply double-click on this batch file.

Method 5: Clear DNS in Chrome and Edge

Certain applications like Google Chrome and Microsoft Edge keep their own DNS cache stored away to improve search speeds. This DNS cache is different from the one that is stored by Windows and will have to be cleared separately. Here’s how to go about clearing it on Chrome and Edge:

In Chrome

  1. Open the Google Chrome application. Then enter the following in Chrome’s address bar: chrome://net-internals/#dns
  2. Then hit Enter. This will lead you to Chrome’s ‘net internals’ page. Click on Clear host cache next to ‘Host resolver cache’.

For Edge

  1. If you’re a Microsoft Edge user, enter the following in the address bar: edge://net-internals/#dns
  2. Then hit Enter. This will lead you to Edge’s ‘net internals’ page. Here, as before, click on Clear host cache.

And just like that, you will have cleared the DNS cache on Chrome and Microsoft Edge.

Method 6: Reset Winsock Settings

If the aforementioned methods do not work for some reason, you can resort to resetting Winsock Settings. Winsock is used to communicate between Windows network software and network services and resetting it is tantamount to clearing the DNS cache as well. Here’s how to go about it:

  1. Press Start, type cmd, then right-click on the best-matched result and select Run as administrator.
  2. Now type the following command: netsh winsock reset
  3. Then hit Enter. If Winsock was reset successfully, you’ll get a message about the same.
  4. Then restart your computer to complete the reset. 

Method 7: Refresh DNS Cache automatically every day

There is a registry modification hack that can help you reset and refresh the DNS cache every 24 hours. Once set up, the reset will occur automatically. Here’s how to go about it:

  1. Press Start, type regedit, and hit Enter.
  2. Now navigate to the following address in the Registry Editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
    Alternatively, copy the above and paste it into the registry editor’s address bar, like so:
  3. Then hit Enter. Now, right-click on empty space on the right, select New, then select DWORD (32-bit) Value.
  4. Name it MaxCacheTtl. Then double-click on it to modify it.
  5. Enter 86400 under ‘Value Data’.
  6. Then click OK.
  7. Next, right-click on empty space again, and create a new DWORD (32-bit) Value.
  8. Name it MaxNegativeCacheTtl. Then double-click on it to modify it.
  9. Set the ‘Value Data’ to 5.
  10. Then click OK.

Then restart your PC for good measure. From now, your DNS cache will reset automatically after every 86400 seconds, or 24 hours.

How to view the current DNS cache

If you’re the curious type and want to know what’s held within your DNS cache currently, here’s how you can view it:

  1. Press the Start button on your keyboard and then type cmd and then click Run as administrator.
  2. Now, type the following command: ipconfig /displaydns
  3. Now hit the enter key to run the command. This will display your current DNS cache data.

Reset DNS Cache

It is often the case that DNS will fail to respond to repeated queries and cache-clearing commands. In such cases, restarting the DNS client may be required. This can be done in a couple of ways:

Disable and Enable DNS Cache from the Command Prompt

  1. Press Start, type cmd, right-click on the best-matched result and select Run as administrator.
  2. Now type the following command: net stop dnscache
  3. Hit Enter. This will disable DNS cache. Now, type the following command to re-enable it: net start dnscache
  4. Then hit Enter. Your DNS cache should now reset. If you get the error message saying that ‘the requested pause, continue, or stop is not valid for this service’, refer to the FIX given below. 

From the Services app

Another way to reset DNS cache is to do so from the Windows Services app. Here’s how to go about it:

  1. Press Start, type services, and hit Enter.
  2. Then look for DNS Client.
  3. Right-click on it and select Restart.
  4. Wait for the DNS client service to restart. Once it does, you can resume browsing or clearing the DNS cache using the methods listed above. 

If the options to Start, Stop, or Restart are greyed out, refer to the FIX given below as a workaround. 

FIX: Cannot restart DNS Client. The requested pause, continue, or stop is not valid for this service

If you get an error message saying that “the requested pause, continue, or stop is not valid for this service”, and are also unable to restart the DNS service from the Services app, then you have to dig a little deeper into the registry to restart the DNS client service. Here’s how to do so:

  1. Open the Registry Editor as shown before. Then navigate to the following address: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache
    Alternatively, copy the above and paste it into the registry editor’s address bar.
  2. Then hit Enter. Now, double-click on Start on the right to modify it.
  3. Set its value to 4.
  4. Then click OK.
  5. Restart your computer for the DNS service to stop. Then, to re-enable it, change the value to 3.

If you wish to revert the changes, simply set the value to 2, which leads to automatic configuration at startup. 

Why flush DNS cache on your Windows 11?

Apart from the obvious benefit of having a relevant website cache and speedy internet navigation, there are two other important reasons why you should flush your DNS cache from time to time. The first is privacy. Sure, DNS doesn’t store information the way your browser cookies do. But it does contain information about the websites that you’ve visited recently and those that you visit regularly. This means that if someone gets access to your DNS cache, your privacy could be compromised.

The other reason is basic security. If cybercriminals get access to your DNS cache, they can change the IP addresses of websites stored there and even insert new ones. Also called DNS poisoning, this can be quite a security problem. If cybercriminals can redirect you to another website, they can gather your sensitive data such as passwords to your accounts and credit card information. 

Clearing the DNS cache will ensure that all the irrelevant and obsolete information about websites is removed, and your internet browsing remains secure. 


So these were the ways that you can flush DNS cache on Windows 11. Doing so is a harmless little thing, but one that can save you from a world of trouble, secure your privacy, and of course, speed up your website navigation.

RELATED