6 Easy Ways to Flush DNS Cache on Windows 11 and 10

Atish is a seasoned tech enthusiast fueled by caffeine and a Computer Science engineering degree. He stumbled into the blogging world in 2015 and hasn’t looked back. Over 2000+ articles later, his work has been featured on sites like Gizbot, Firstpost, PhoneArena, GSMArena, and IBTimes. At GT, he’s your go-to guy for how-tos, invaluable tips, and troubleshooting guides that actually work. He’s also an SEO and digital marketing whiz and content strategist, so his tech takes are always on point and ethical.

Have you ever encountered trouble accessing a website or service and wondered why it wasn’t loading? This can sometimes be caused by an outdated DNS cache, which stores previously accessed website addresses. Fortunately, flushing the DNS cache is a simple solution to resolve these issues. In this article, we’ll guide you on how to flush DNS cache on Windows 11 and 10.

Before we move forward, it is essential to understand what a DNS cache is. In basic terms, DNS cache is a feature that stores information about your recently accessed websites and acts as a temporary database to speed up the browsing experience.

However, if a website’s IP address changes, your computer may still try to access the old address due to the cached DNS information. You may encounter errors when attempting to access the site. Hence, to fix this, you must flush DNS cache. Let’s show you how.

1. Flush DNS Cache Using Command Prompt

Command Prompt lets you do a wide variety of functions, including program launches, managingnetwork settings, performing system administration tasks,troubleshooting common computer issues, and so on. This also includes clearing the DNS cache on the Windows machine. Follow the steps below.

Step 1: Press the Windows key on your keyboard, typeCommand Prompt, and click ‘Run as administrator.’

In the prompt, select Yes.

Step 2: Type the following command and press Enter.

Afterward, you will see a message stating that the DNS resolver cache has been flushed. If this method fails, you can check out the following method.

2. Using Windows PowerShell

PowerShell is no different from Command Prompt. Even PowerShell provides a wide range of functionalities, and clearing the DNS cache is one of them. Follow the below-mentioned steps to do so.

Step 1: Press the Windows key on your keyboard, typePowerShell, and click ‘Run as administrator.’

In the prompt, select Yes.

Step 2: Type the below command and press Enter.

That’s it. With this, the DNS cache gets cleared hassle-free. Check out the next method if you don’t want to access the command-line terminal but want to clear the DNS cache.

3. Using Run

For this method, we will be utilizing the Run window. Considering the above two methods, this may seem easier. Follow the instructions below.

Step 1: Press the ‘Windows key + R’ on your keyboard to open the Run dialog box.

Note:Alternatively, press the Windows key on your keyboard and type Run.

Step 2: Type the below command in the text field and click OK.

You will see a command window for a split second, and your DNS cache will be flushed. If you are not looking for a one-time solution but want to access the function whenever you want quickly, jump to the next method.

4. Using a Batch File

Setting up abatch filewould be of great help if you want a one-click solution that resets DNS whenever you need to. Follow the below-mentioned instructions.

Step 1: Right-click on the desktop, select New from the context menu, and choose Text Document.

Step 2: Name the file and press Enter key on your keyboard.

Eg: Flush DNS

Step 3: Type the below command.

Step4: Click on the File menu, and from the drop-down menu, click on Save as.

Note:You can also save the file by pressing ‘Ctrl+Shift+S’.

Step 5: Click the ‘Save as type’ drop-down menu and choose All files.

Step6: Add .bat extension to the file name.

Step 7: Finally, click Save.

From now on, whenever you need to clear the DNS cache, you only need to double-click on this batch file. If none of the abovementioned methods worked for you, the next one will.

5. Reset Winsock Settings

Winsock (Windows Sockets) is a programming interface that handles input/output requests for Internet applications in the Windows operating system. This includes refreshing the DNS cache from your Windows PC. Follow the instructions below.

Step 1: Press the Windows key on your keyboard, typeCommand Prompt,and click ‘Run as administrator.’

In the prompt, select Yes.

Step 2: Type the below command and hit Enter.

You will get a message saying that Winsock has been successfully reset. Afterward, you must restart your computer for the settings to take effect.

6. Refresh DNS Cache Automatically Using the Registry Editor

This method is more complex than the above one, but the steps are simple to follow and execute. However, because we will be using Registry Editor, we strongly advise you toback up the Windows Registrybefore proceeding with the steps below.

Step 1: Press the Windows key on your keyboard, typeRegistry Editor, and click ‘Run as administrator.’

Note: Press ‘Windows key + R’ to open the Run dialog box, typeregedit.exe, and click OK toopen Registry Editor.

In the prompt, select Yes.

Step 2: In the top address bar, enter the mentioned address.

Note: You can manually navigate to the section too.

Step 3: Under the Parameters folder, right-click, select New, and choose ‘DWORD (32-bit) Value.’

Step 4: TypeMaxCacheTtlin the name field.

Step 5: Double-click on MaxCacheTtl, type86400in the Value Data field, and press OK.

Step 6: Under the Parameters folder, right-click again, select New, and choose ‘DWORD (32-bit) Value.’

Step 7: TypeMaxNegativeCacheTtlin the name field.

Step 8: Double-click on MaxNegativeCacheTtl, type 5 in the Value Data field, and press OK.

Finally, restart the system to implement the changes. And that’s it! When the system boots back, your Windows machine will flush the DNS cache automatically after every 86400 seconds or 24 hours.

How to Flush Your Browser’s DNS Records

In order to improve the speed of search, browsers store the DNS cache. Since each browser stores the details, it is necessary to clear them separately. Follow the steps below.

Step 1: Launch Google Chrome or Edge, enter the below address, and press Enter.

This will take you to Chrome’s or Edge’s net internals page.

Step 2: Click on the ‘Clear host cache’ button.

With that, you have successfully cleared the DNS cache from your preferred browser. Continue reading if you want to reset the DNS cache at a set time on a particular interval.

Now that you have cleared the DNS cache, you may want to view your current DNS cache. Move to the next method.

How to View the Current DNS Cache

Step 1: Press the Windows key on your keyboard, typeCommand Prompt, and click ‘Run as administrator.’

In the prompt, select Yes.

Step 2: Type the below command and press Enter.

There you go. This will display your current DNS cache data. If you have any queries, check out the FAQ section below.

FAQs on Flushing DNS Cache on Windows

No, flushing the DNS cache is a relatively safe operation commonly used to resolve DNS-related issues. However, there are a few risks, such as slow performance, security risks, website access issues, etc.

For the most part, you do not need to restart your computer after flushing the DNS cache. When you run the flush cache command, the changes should take effect immediately. However, if you need to ensure DNS-related processes are running properly, restart your computer.

Clear DNS Cache

Whether you’re experiencing slow internet speeds or encountering errors while browsing, knowing how to flush DNS cache can help resolve the issue.

With the step-by-step guide in this article, you can quickly refresh the DNS cache on your Windows and get back to browsing the web without any interruptions. You may also want to readhow to change the DNS server on Android and iPhone.

Was this helpful?

Last updated on 27 March, 2023

Leave a ReplyCancel reply

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

Name*

Email*

Comment*

Δ

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.

More in Windows

7 Ways to Fix Apps Not Opening on Windows 11

6 Ways to Fix Failed to Load Web Page Error in Steam for Windows

JOIN THE NEWSLETTER

Get Guiding Tech articles delivered to your inbox.

© 2024 Guiding Tech Media. All Rights Reserved.