In this guide, you will learn how to clear the DNS cache on Windows 10. These steps will also work with other Windows versions.
Windows will cache DNS lookups to help speed up name resolution. Over time this cache can become corrupt or contain outdated DNS information. This can impact network performance or result in failed network connection attempts.
Windows provides a command to quickly flush the DNS cache and a command to view the DNS cache. If you have a local Windows DNS server you may need to clear the cache on it as well.
Let’s get started.
Clear DNS Cache on Windows 10
This also works on older Windows operating systems.
Step 1: Open the command prompt
Click the Windows start button and type cmd.
Click on Command Prompt to open.
Step 2: Enter the following command
With the command prompt open type:
ipconfig /flushdns
That’s it for flushing the local cache. If you want to check the local cache then move on to step 3.
Step 3: View DNS Resolver cache (Optional)
If you want to view the local DNS cache use the command below. This can be used to check what your local computer has in its DNS cache.
ipconfig /displaydns
This will display all the local cache entries.
Clear DNS Cache on Windows DNS Server
Maybe it’s not a local client issue, maybe your server has a bad cache entry. Follow these steps to clear the cache on your Windows Server.
In this example, I’m using Windows Server 2016.
This is super easy, just open the DNS console, right-click the DNS server, and select clear cache.
Clear DNS Cache Using PowerShell
To clear the client cache using PowerShell use this command:
Clear-DnsClientCache
To clear the local DNS server cache use this command:
Clear-DNsServerCache
To clear the DNS cache on a specific DNS server use this command. Change -ComputerName to the name of the server you want to clear.
Clear-DnsServerCache –ComputerName “DC1” -Force
If you still have DNS issues then check out my guide on how to use nslookup to test and verify DNS records. The guide also includes 8 tips for troubleshooting DNS problems.
Leave a comment below