DNS cache corruption might cause various network-related issues on a Windows PC. It can prevent you from accessing a website and worsen your browsing experience. However, flushing the accumulated DNS cache can immediately resolve the problem. In this tutorial, we’ll check out 6 working methods to clear the DNS cache on Windows 10 and 11.

The DNS (Domain Name System) resolves domain names to IP addresses to speed up web browsing. Flushing the DNS resets the saved information and fetches new data from the server.

Don’t Miss: How to Clear System Cache and Clean a Windows PC

Table of Content

1. Using the Flush DNS Command in CMD

If you want to clear your DNS cache on Windows, you can do so by using the Command Prompt. Follow these steps:

  1. Open a Command Prompt window.
  2. Execute the following command in the Command Prompt window.
    ipconfig /flushdns

    flush dns cache via windows command prompt

  3. When the DNS record is cleared, you’ll get the following output in the CMD window.
    Windows IP Configuration
    Successfully flushed the DNS Resolver Cache.

That’s it!

2. Using DNS Cache Command in PowerShell

You can also clear the DNS record in Windows 10 and 11 using a PowerShell command.

  1. Launch a PowerShell window.
  2. Type or paste the following command in the PowerShell window.
    Clear-DnsClientCache
  3. Once you hit Enter, your DNS cache will be cleared, and you’ll be good to go.clear dns cache in windows powershell

3. Using the Run Dialog Box

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

  1. Open the Run dialog box on your PC using the Windows + R keyboard shortcut to launch it.
  2. Type or paste the following command in the text box next to Open.
    ipconfig /flushdns

    fluch dns cache using windows run dialog

  3. Now, click the OK button. To run the ipconfig /flushdns command as an administrator, press Ctrl + Shift + Enter keys after typing the command in the Run dialog.
How to Flash Firmware on Galaxy S25 with Odin and Keep Data

4. Flush DNS using a Batch File

Flushing DNS via a batch file might seem complicated, but it works flawlessly. The good thing about this method is that if you create a batch file once, you can run it whenever you want to manage the DNS. Here is how to do it.

  1. Open the Notepad app. Use the Windows Search feature and type “Notepad” to find the app quickly.search for notepad in windows
  2. Now, type or paste one of the following entries in the Notepad file.
    ipconfig /flushdns

    or

    cmd.exe /k ipconfig /flushdns

    type the flush dns command in notepad file

  3. Click File > Save or 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 the Save button.save flush dns batch file in windows
  6. Navigate to the FlushDNS.bat or ClearDNS.bat file and double-click it.run flush dns batch file to clear dns cache in windows
  7. Doing so will launch the Command Prompt and execute the ipconfig /flushdns command.

5. Flush DNS Automatically via Registry

Using the Windows Registry editor hack 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 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.
    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
  2. Right-click an empty area in the right-hand pane and select New > DWORD (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 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, right-click an empty area again and select New > DWORD (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 OK to save the changes.change max negative cache ttl value data in registry editor

You have successfully scheduled the automatic DNS flush on your Windows computer every 24 or 48 hours.

6. Stop DNS from Heaping up via Control Panel

Using this bonus tip, you can configure your Windows PC so the DNS cache doesn’t overpopulate. This way, you can avoid issues caused by the DNS dump.

  1. Open the Control Panel.
  2. Click Network and Internet > Network and Sharing Center.
  3. On the left-hand side of the window, click Change adapter settings.network and sharing settings center in windows
  4. Right-click your active network connection and select Properties.network connection settings windows 11
  5. Select Internet Protocol Version 4 (TCP/IPv4) from the list of items and click Properties.ethernet properties windows 11
  6. 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
  7. Click OK to save your changes.
  8. Close the Control Panel window and restart your computer for the changes to take effect.

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 the Chrome, Edge, Opera, and Firefox web browsers.

Was this Article helpful?
YesNo