DNS Clients in Windows has the ability to cache DNS Queries as does most of the clients on other operating systems. This helps the DNS clients to resolve recently accessed web pages faster by resolving the IP Address directly from its cache rather than querying a DNS server. However, the time the cached information stored is purely dependent on the TTL (Time To Live) value defined in the Domain DNS Records. In the screenshot shown below, you can see the TTL value for www.itsyourip.com set to 84463 seconds. It is important that one knows how to handle these cache when troubleshooting a problem. This article describes how to Display or copy the DNS Cache and Clear or Flush the DNS Cache in Windows. This should work in Windows 2000,XP and higher.
To display the DNS Cache,
1. Click Start and RUN
2. Type CMD and press Enter or click OK
3. This should take one to the DOS command window
4. Type IPCONFIG/DISPLAYDNS and press Enter.
This will Display the entries in the DNS Cache at that time as in the following screen shot. 
To copy the contents of the DNS Cache onto a Text file,
1. Click Start and RUN
2. Type CMD and press Enter or click OK
3. This should take one to the DOS command window
4. Type IPCONFIG/DISPLAYDNS > FILE.TXT and press Enter.
Example:
ipconfig/displaydns > c:\dnscache.txt
Now, open the Text file from an editor like notepad and you should be able to see the DNS Cache entries copied to the text file.
To clear or Flush the DNS Cache,
1. Click Start and RUN
2. Type CMD and press Enter or click OK
3. This should take one to the DOS command window
4. Type IPCONFIG/FLUSHDNS and press Enter.
This will clear the DNS Cache and return a message as in the following screenshot. 
Leave a Reply