JSI Tip 5918. How can I view and configure the DNS cache content on Windows NT 5.X?

Jerold Schulman

November 5, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today

When a Windows 2000 (NT 5.0), Windows XP (NT 5.1), or Windows .NET Server (NT 5.2) queries a DNS server, it caches the positive and negative responses in the local DNS cache. This prevents these DNS clients from having to query the DNS server for the same address. The positive responses are stored in the DNS cache for 24 hours and the negative responses are stored for 5 minutes.

To display the contents of the DNS cache, which also include entries that were preloaded from the Hosts file, open a CMD prompt and type ipconfig /displaydns. The display includes the remaining Time To Live (TTL), in seconds.

You can clear the DNS cache by typing ipconfig /flushdns.

You can configure the default TTL:

1. Use the Registry Editor to navigate to:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesDnscacheParameters.

2. Double-click the MaxCacheEntryTtlLimit Value Name, a REG_DWORD data type, and change thepositive response limit, using the Decimal Radix, from 86400 Seconds (24 hours) to the TTL value you desire.

3. Double-click the NegativeCacheTime Value Name, a REG_DWORD data type, and change the negative response limit, using the Decimal Radix, from 300 Seconds (5 minutes) to the TTL value you desire. You can set the data value to 0 to prevent caching negative responses.

4. Exit the Registry Editor.

5. Open a CMD prompt and type:

net stop dnscache
net start dnscache


NOTE: This will flush the DNS cache, reloading the entries from the Hosts file, and cause your changes to take affect.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like