What Is DNS Cache on Windows and How Do I Flush It?

0

DNS, or Domain Name System, is an important protocol for resolving network inquiries. It is essential in directing us to the right places on the internet. However, there are times when it is necessary to troubleshoot your DNS. Some users may consider changing their DNS servers, but it is often equally effective to flush the DNS cache on Windows.

In this guide, we explore all you should know about the Windows DNS as well as show you the different ways to flush it.

What is the DNS Cache?

Your DNS cache is a temporal storage for all lookups from your computer or browser. The cache increases the speed and efficiency of resolving IP addresses and URLs since your computer does not need to send out new queries whenever a lookup is requested.

The DNS lookup process involves a resolver, a root server, and a TLD server, and the cache ensures that all servers are not queried, reducing the number of steps.

How do I clear the DNS Cache in Windows?

1. Flush the Windows DNS Cache Using the Command Prompt

The Command Prompt in Windows 11 allows users to interact with the operating system through text-based commands. The command-line interpreter carries out the instructions that you input. You could pass a simple command that clears your DNS cache on Windows.

Step 1: Press Windows + R to open the Run dialog.

Step 2: Type cmd and hit Ctrl + Stift + Enter to open an elevated Command Prompt.

Open the command prompt - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Type the script below and hit Enter, and the DNS cache will be purged.

ipconfig /flushdns
Flush dns cache on cmd 600x112 - What Is DNS Cache on Windows and How Do I Flush It?

2. Flush the Windows DNS Cache Using the PowerShell

Like the Command Prompt, the PowerShell also uses scripts to interact with the operating system. The PowerShell scripting language can automate tasks or perform network operations like purging the DNS cache.

Step 1: Click the magnifying lens on the Taskbar, type PowerShell, and click Run as administrator.

opening the PoweShell 600x584 - What Is DNS Cache on Windows and How Do I Flush It?

Step 2: Type the command below and hit Enter, and the DNS cache will be purged.

Clear-DnsClientCache
Clearing dns cache with the powershell 600x113 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Optionally, you may use the script below:

ipconfig /flushdns

3. Clear DNS Cache on Windows Using the Run Dialog

Windows’ Run dialog is a tiny window that gives you quick access to programs, files, and settings. You can also type simple commands that clear the Windows DNS cache.

Step 1: Press Windows + R to open the Run dialog.

Step 2: Type the command below and hit Enter.

ipconfig /flushdns
Flush DNS cache from Run - What Is DNS Cache on Windows and How Do I Flush It?

4. Clear DNS Cache from Browser

Your browsers also give an option to clear the DNS cache. The method will vary by browser, and we will show you how to do it on three major Windows-compatible browsers.

4.1 Using Chrome

Step 1: Launch your browser.

Step 2: Input the path below in your URL bar and hit Enter.

chrome://net-internals/#dns
Address locator 600x148 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Click the Clear host cache button.

clear host cache 600x141 - What Is DNS Cache on Windows and How Do I Flush It?

4.2 Using Firefox

Step 1: Launch your browser.

Step 2: Input the path below in your URL bar and hit Enter.

about:networking#dns
Firefox dns cache 600x130 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Click the Clear DNS Cache button.

DNS cache 600x236 - What Is DNS Cache on Windows and How Do I Flush It?

4.3 Using Microsoft Edge

Step 1: Launch your browser.

Step 2: Input the path below in your URL bar and hit Enter.

edge://net-internals/#dns
Edge address locato for DNS cache 600x137 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Click the Clear host cache button.

Clear edge host cache 600x261 - What Is DNS Cache on Windows and How Do I Flush It?

5. Purge the Windows DNS Cache using a Batch File

A batch file is a text document that contains a series of commands. The command line interpreter executes these commands that can affect the computer in various ways. You may use batch files to perform network-related tasks like clearing your DNS cache.

Step 1: Search for Notepad on Windows Search, and open the app. Optionally, you may use any other text editor on your device.

Notepad 1 600x576 - What Is DNS Cache on Windows and How Do I Flush It?

Step 2: Enter the script below in the NotePad.

@echo off
rem This batch file will clear the Windows DNS cache.
ipconfig /flushdns
rem Press any key to continue.
pause
notpad batch file 600x314 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: Click File, then Save as.

Save as 2 600x314 - What Is DNS Cache on Windows and How Do I Flush It?

Step 4: Choose a name for the file, add .bat at the end, and save it.

Step 5: Right-click the bat file and select Run as administrator, and your DNS cache should be cleared.

clear dns cache 600x363 - What Is DNS Cache on Windows and How Do I Flush It?

6. Automatically Clear Windows DNS Cache Using the Registry Editor

Clearing the DNS cache on Windows 11 can be automated to run on a schedule for frequent problems. To do that, you will have to use the Registry Editor. However, we only suggest tampering with it if you know about what you are doing. Below are the steps:

Step 1: Press Windows + R, type regedit, and hit Enter.

Launching the registry editor - What Is DNS Cache on Windows and How Do I Flush It?

Step 2: Navigate to the path below:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
registry edito DNS parameters folder 600x350 - What Is DNS Cache on Windows and How Do I Flush It?

Step 3: On the right pane, right-click a space, click New, then DWORD (32-bit) Value.

DWORD value 600x350 - What Is DNS Cache on Windows and How Do I Flush It?

Step 4: Name the newly created DWORD MaxCacheTtl, then double-click on it.

New value - What Is DNS Cache on Windows and How Do I Flush It?

Step 5: Input a Value data figure. This should be the time in seconds before the DNS is automatically cleared. We use 10000 in this example. Finally, click OK.

Enter value data - What Is DNS Cache on Windows and How Do I Flush It?

Step 6: Repeat step for, but this time, name the new DWORD MaxNegativeCacheTtl.

Step 7: Change the Value data property to 5 and click OK.

Change new value data - What Is DNS Cache on Windows and How Do I Flush It?

Step 8: Close the Registry Editor, and your DNS cache should automatically clear at the selected time interval.

FAQ on Flushing DNS Cache on Windows

1. What does flushing DNS cache do?

This process clears all stored copies of DNS records and forces your device to request new DNS records from the DNS server.

2. Is it safe to flush DNS cache?

Flushing your DNS cache is face and recommended. Note that it does not delete your browser history.

3. How often does Windows flush DNS cache?

There is no set frequency for DNS flushing. However, it is recommended to flush the DNS cache for optimal browsing experience frequently.

Using the PC After Flushing Its DNS Cache

Flushing the DNS cache is a helpful network troubleshooting step if you can not access an online resource or website. It also comes in handy for the error message The DNS server cannot be found or if you are experiencing slow internet speeds.

All the solutions in this guide will improve your surfing experience. So it would be best if you used whichever feels the most practical.

LEAVE A REPLY

Please enter your comment!
Please enter your name here