Skip to content

6 Ways to Flush or Clear DNS Cache in Windows 10 & 11

Are you encountering internet connection issues or facing trouble accessing certain websites? It may be due to a corrupted DNS cache or dumping of DNS in your Windows PC. In this tutorial, we’ll discuss 4 methods to flush or clear the DNS cache in Windows 11 and 10. Before getting into the various ways you can flush the DNS cache in Windows, let’s learn what DNS is and how it works.

What is DNS and Why Clear the DNS Cache?

DNS, or Domain Name System, is a decentralized system that translates human-readable domain names (like into IP addresses (like It is like a phonebook for the internet. Whenever you visit a website, your computer sends a DNS request to a DNS server asking for the IP address associated with the domain name. The DNS server responds with the requested IP address, and then your computer loads the website.

DNS caching is used to speed up the process of resolving domain names to IP addresses. When a DNS server responds to a DNS request, it also includes information about other domains that are related to the one being requested. This allows your computer to store this information in its DNS cache so that it doesn’t have to send another DNS request for these related domains later on.

So, why and when do we need to clear the DNS cache? Well, there can be many answers to this question but the most common reasons to clear DNS Cache are:

  • The DNS cache has corrupted or it’s out of date.
  • You’ve recently changed the DNS settings for your domain and you want your computer to start using the new settings immediately.
  • If a website has moved to a different server and it’s not loading properly for you, flushing the DNS can fix it.
  • Clearing the DNS can also fix the “404 Page Not Found” error in some cases.
  • You want to make sure that you’re seeing the most up-to-date version of a website.

When you clear your DNS cache, you are clearing the entries in your local DNS server that correspond to websites you have recently visited. This can be useful if you have changed DNS servers, or if you think something is wrong with the DNS entries stored on your computer.

How to Flush DNS Cache in Windows 10 & 11

If you’re having trouble connecting to a website or service, one of the first things you can do is flush your DNS cache. This will reset your DNS information and fetch new data from the server. Here are 5 methods to clear the DNS cache in Windows 10 and 11.

Method 1: Flush DNS Cache using Command Prompt

If you want to clear your DNS cache on Windows, you can do so by using the Command Prompt. This method is quick and easy, and it will usually clear any DNS issues that you may be having. To flush your DNS cache using the Command Prompt, follow these steps:

  1. Open the Command Prompt or CMD window. You can use one of these 18 ways to open the Command Prompt in Windows 10 or 11.
  2. Execute the following command in the Command Prompt window.flush dns cache via windows command prompt
  3. When the DNS cache is cleared, you’ll get the following output in the CMD window.
    Successfully flushed the DNS Resolver Cache.

That’s it! Your DNS information will now be reset and you should be able to connect to the website or service you were having trouble with.

If the Command Prompt commands are not working for you in the CMD, you can follow our guide to fix the issue.

Method 2: Clear DNS Cache using Windows PowerShell

There are a lot of simple and complicated tasks that you can do using Windows PowerShell commands. You can also clear the DNS cache in Windows 10 and 11 using a command in PowerShell.

  1. Launch a PowerShell window. There are 17 ways to open a Windows PowerShell in Windows 10 and 11.
  2. Type or paste the following command in the PowerShell window.
  3. Once you hit Enter, your DNS cache will be cleared and you’ll be good to go.clear dns cache in windows powershell

Method 3: Clear DNS Cache via the Run Dialog

Another quick way to clear the DNS cache in Windows involves using the Run dialog box. Here’s how to do it.

  1. Open the Run dialog box on your PC. You can do so by using the Windows + R keyboard shortcut to launch it. If you want to perform tasks faster, do not forget to check out these 250 Windows keyboard shortcuts.
  2. When the Run dialog is launched, type or paste the following command in the text box located next to Open.
    ipconfig /flushdnsfluch dns cache using windows run dialog
  3. Now, click on the OK button. If you want to run the ipconfig /flushdns command as an administrator, press Ctrl + Shift + Enter keys after typing the command in the Run dialog.

Method 4: Flush DNS Cache using a Batch File

The 3 methods described above are the easiest and quickest ways to clear DNS cache in Windows 10 and 11. However, there are a few more ways to do that. You can create a batch file and run it whenever you want the DNS cache to be flushed. Here is how to do it.

  1. Open the Notepad app. You can find it among the pre-installed apps on your PC. You can also use the Windows Search feature and type Notepad to find the app for notepad in windows
  2. Now, type or paste one of the following entries in the Notepad file.
    ipconfig /flushdns
    cmd.exe /k ipconfig /flushdns

    type the flush dns command in notepad file

  3. Click on File > Save or simply press Ctrl + S keyboard shortcut to save the file.notepad file saving option
  4. When the Save as window pops up, click next to Save as type and select All files(*.*).select all files type to save notepad
  5. Next, type FlushDNS.bat, ClearDNS.bat, or any other name (with ‘.bat‘ extension) that you prefer in the File name section and click on the Save flush dns batch file in windows
  6. Navigate to the location where you saved the FlushDNS.bat or ClearDNS.bat file and double-click on flush dns batch file to clear dns cache in windows
  7. Doing so will launch the Command Prompt and execute the ipconfig /flushdns command.

Method 5: Flush DNS Cache Automatically via Registry Editor

While other methods mentioned above require manual action every time you want to clear the DNS cache in your Windows PC, there is another way to automate things. Using the Windows Registry editor hack given below, you can schedule the flushing or clearing of the DNS cache. Let’s see how we can do this.

Warning: Before you proceed with the steps given below, please create a system restore point and back up your registry settings using File > Export… in the Registry Editor window.

  1. Open the Registry Editor and navigate to the following path. Alternatively, you can paste the following path into the address bar of the Registry Editor window and press the Enter key to get to that location.
  2. Click on an empty area in the right-hand pane and select New > DOWRD (32-bit) Value.create a new dword entry in registry editor
  3. When the new DWORD file is created, name it “MaxCacheTtl“.max ttl dword entry registry editor
  4. Now, right-click on MaxCacheTtl and select Modify to edit its properties.
  5. Change the Value data to 86400 or 172800 (seconds) to clear the DNS cache automatically every 24 or 48 hours respectively. You can set this value as per your preference. Click on the OK button to save the changes.change max ttl value data in registry editor
  6. Now, click on an empty space again and select New > DOWRD (32-bit) Value.
  7. This time, name this new file MaxNegativeCacheTtl.create max negative cache ttl dword entry in registry editor
  8. Double-click MaxNegativeCacheTtl, modify its Value data to 5 and click on OK to save the changes.change max negative cache ttl value data in registry editor

That’s it! You have successfully scheduled the automatic flushing of the DNS cache on your Windows computer every 24 or 48 hours.

Don’t Miss: 17 Windows Registry Hacks, Tweaks & Mods

Method 6: Stop the DNS Cache from Heaping up via Control Panel

Using this bonus tip, you can configure your Windows PC so that the DNS cache doesn’t overpopulate itself. This way, you can avoid issues caused by the DNS cache. Let’s see how to use the Control Panel to flush the DNS cache in Windows.

  1. Open the Control Panel.
  2. Click on Network and Internet.
  3. Click on Network and Sharing Center.
  4. On the left-hand side of the window, click on Change adapter and sharing settings center in windows
  5. Right-click on your active network connection and select connection settings windows 11
  6. Select Internet Protocol Version 4 (TCP/IPv4) from the list of items and click on Properties.ethernet properties windows 11
  7. Under General, check the box next to Obtain an IP address automatically and uncheck the box next to Use the following DNS server addresses.internet protocol version 4 properties windows 11
  8. Click on OK to save your changes.
  9. Close the Control Panel window and restart your computer for the changes to take effect.

Flushing the DNS cache can be a helpful troubleshooting step to take when your computer is having connectivity issues. We hope this article helped you understand what flushing DNS means and how to do it quickly and effectively in Windows 10 and 11. Now that you’ve learned how to flush your cache, take some time to explore how to clear browser cache and cookies in Chrome, Edge, Opera, and Firefox web browsers.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.