This post explains how to view / flush DNS cache on the local machine from command prompt. The DNS resolver cache stores the IP addresses for the websites recently visited from this computer. The cache entries can be retrieved using the below command.
ipconfig /displaydns
Example:
C:\>ipconfig /displaydns
Windows IP Configuration
www.windows-commandline.com
----------------------------------------
Record Name . . . . . : www.windows-commandline.com
Record Type . . . . . : 5
Time To Live . . . . : 272
Data Length . . . . . : 8
Section . . . . . . . : Answer
CNAME Record . . . . : windows-commandline.com
www-google-analytics.l.google.com
----------------------------------------
Record Name . . . . . : www-google-analytics.l.google.com
Record Type . . . . . : 1
Time To Live . . . . : 58
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 216.58.216.142
There are more DNS records printed for the above example, showing only couple of records here.
Now let’s see how can we flush the contents of DNS cache. This is frequently used by domain admins when they update the hosting server address in their domain settings. Flushing removes the record stored on the local host and triggers contacting the domain name servers on the internet for the IP address.
Command to flush dns cache
ipconfig /flushdns
Example:
C:\>ipconfig /flushdns Windows IP Configuration Successfully flushed the DNS Resolver Cache.
Now if you print dns cache records you may not see anything.
C:\>ipconfig /displaydns Windows IP Configuration Could not display the DNS Resolver Cache.
Note that it’s not guaranteed to see empty output with /displaydns command, as there could be some application contacting some website in the background and the DNS cache is filled with new records immediately. But you can rest assured that all the previously cached records were deleted.
Adding users from command line is much easier than going through the UI. It saves…
Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…
We can kill a process from GUI using Task manager. If you want to do…
Chrome is definitely the stable browser compared to other ones and it has been my…
Windows has multiple command line utilities that can help find the version of the Windows…
There are multiple ways to check whether a Windows computer is running 32-bit OS or…
View Comments
I cleared dns cache multiple times but still ping domainname shows the old ip address configured, does not update to the new address I added on my domain registrar,
Hello how can flushdns from pc network