3 Methods To Clear the DNS Cache in Windows 10/11
In this article, we want to teach you How to Clear the DNS cache in Windows. Before you start to learn how to clear the DNS cache, let’s see what DNS and DNS cache are.
The Domain Name System (DNS) converts human-readable domain names into Internet Protocol or IP addresses. Computers can only communicate using a series of numbers, so DNS was developed as a sort of “phone book” that translates the domain you enter in your browser into a computer-readable IP.
A DNS cache is a local storage that contains the records of a computer’s query history, including recent website visits. The operating system (OS) uses caching to store DNS resource records, which avoids redundancy when attempting to access a web page and therefore decreases DNS lookup latency.
If a machine has recently visited the page it wants to access, the cache can supply the IP address of its web server, completing the website request before the lookup has to query the DNS server.
You can now proceed to the following steps provided by the Orcacore website to Clear the DNS cache in Windows.
When Do You Need to Clear the DNS Cache in Windows?
You may ask yourself when it is the right time to Clear the DNS cache in Windows. Here are common reasons to clear the DNS cache:
-
Website Loading Issues: If a website is not loading correctly, displays an old version, or gives an error message, the DNS cache might be storing outdated information.
-
Security Concerns: A compromised DNS server could poison your cache with malicious entries, directing you to fake websites. Clearing the cache can mitigate this risk.
-
IP Address Changes: When a website’s IP address changes, your cached DNS records might point to the old address, preventing you from accessing the site.
-
Troubleshooting Network Problems: Clearing the DNS cache is a common troubleshooting step when diagnosing network connectivity issues.
Now follow the steps below to see how we can clear the DNS cache. In this guide, we will show you three methods to do this including:
- Using Command Prompt (CMD)
- Using PowerShell
- Using Windows Settings
Method 1. Use CMD To Flush DNS Cache in Windows
First of all, on your Windows Client open the Run window with the Winkey+R.
Then, type the cmd to open the Command Prompt window.
Note: You can also search Command Prompt in your start menu to access the cmd environment.
Now run the following command to flush or clear the DNS cache:
ipconfig /flushdns
After a moment in your output, you will see:
**Output**
Windows IP configuration successfully flushed the DNS Resolver Cache.
It means that you have successfully cleared your DNS cache, and if the sites didn’t open because of the DNS, it will solve this.
Tips: To get more information about CMD commands, you can check this guide on Learn Essential Windows CMD Commands.
Method 2. Use PowerShell To Flush DNS Cache in Windows
Another method to do this is to use PowerShell. First, you must run PowerShell as an administrator.
Then, from your PowerShell, you can run the following command to Clear the DNS Cache in Windows:
Clear-DnsClientCache
In the output, you may not see any message in PowerShell. If no error message appears, the DNS cache is cleared successfully.
Method 3. Use Windows Settings To Flush DNS Cache in Windows
In this method, from your Run box, you need to type services.msc
to open the services in Windows.

In the Services window, find DNS Client. Next, you must right-click on the DNS Client and select Restart.
If the Restart option is grayed out, you need to stop and start the service manually. To do this, right-click DNS Client and click Stop. Then, right-click DNS Client again and click Start.
Note: Restarting the DNS Client service also Clears the DNS cache.

Conclusion
At this point, you have learned to Clear the DNS cache in Windows. As you saw, you can easily use the command line options including CMD and PowerShell to flush your DNS Cache. Also, you can use Windows services to restart the DNS client. This will also clear the DNS cache.
Hope you enjoy it. You may also like the following articles:
Top 5 Open Source DNS Servers For Linux and Windows
FAQs
Does clearing the DNS cache affect the browsing history?
No. It does not delete your browser history, cookies, or saved data. It only removes cached DNS records stored by your system.
After clearing the DNS cache do I need to restart the system?
No, you don’t need to restart your system.
Does clearing the DNS cache improve internet speed?
Generally, it doesn’t improve the internet speed. However, if there are outdated or incorrect DNS entries causing delays or errors, it can help load websites correctly and resolve slow-loading issues.
Alternative Methods to Clear the DNS Cache
While the above methods are effective, here are two alternative approaches to consider:
1. Using a Batch File
This method involves creating a simple batch file that contains the command to flush the DNS cache. This can be particularly useful for automating the process or for users who prefer a graphical interface.
Explanation:
A batch file is a simple text file containing a series of commands that the operating system executes sequentially. By creating a batch file with the ipconfig /flushdns
command, you can execute the DNS flush with a simple double-click.
Steps:
- Open Notepad (or any text editor).
- Type the following command:
@echo off
ipconfig /flushdns
pause
- Save the file with a
.bat
extension (e.g.,flushdns.bat
). Make sure the "Save as type" is set to "All Files" to prevent Notepad from adding a.txt
extension. - Right-click the batch file and select "Run as administrator". The Command Prompt window will open, execute the command, and display the success message. The
pause
command keeps the window open until a key is pressed, allowing you to see the output.
Code Example (Batch File):
@echo off
ipconfig /flushdns
echo DNS cache successfully flushed.
pause
2. Utilizing Third-Party DNS Management Tools
Several third-party DNS management tools offer a user-friendly interface and additional features beyond simply flushing the DNS cache. These tools often provide insights into DNS settings, allow for easy switching between DNS servers, and can automate the flushing process.
Explanation:
These tools act as a simplified interface for managing DNS settings. They typically offer a one-click solution to flush the DNS cache and often include other network diagnostic tools.
Example (Illustrative):
While I cannot recommend a specific tool without knowing your specific needs and security preferences (always exercise caution when installing third-party software), a hypothetical example interaction might look like this:
- Download and install a reputable DNS management tool.
- Open the application.
- Look for an option labeled "Flush DNS Cache" or similar.
- Click the button to initiate the flush. The tool will likely display a confirmation message upon completion.
Code Example (Conceptual – using a hypothetical DNS management library):
While a direct code example isn’t applicable since it relies on the chosen tool’s specific API, the following illustrates the conceptual use of a hypothetical DNS management library in Python:
# Hypothetical DNS Management Library
import dns_manager
try:
dns = dns_manager.DNSManager()
dns.flush_cache()
print("DNS cache flushed successfully.")
except dns_manager.DNSError as e:
print(f"Error flushing DNS cache: {e}")
Choosing the Right Method:
The best method for you depends on your comfort level with command-line interfaces, your need for automation, and whether you prefer using third-party tools. The built-in methods are generally sufficient for most users, while batch files offer a convenient way to automate the process. Third-party tools can provide additional features and a more user-friendly experience, but it’s essential to choose reputable software and exercise caution when installing them.
By understanding these alternative methods, you can choose the most efficient and convenient way to Clear the DNS cache in Windows for your specific needs.