Configure how long to cache negative DNS replies

7 April 2003 by Snakefoot | Comment » | Trackback Off
When accessing a domain like www.google.com it first has to convert the domain to an IP Address. This domain resolution is performed by sending the domain to a DNS server which replies back with the IP Address. This conversion can be seen when pinging a domain.

With Windows 2000 the DNS Client caches the DNS lookups, so it doesn't have to spend time on contacting the DNS Server all the time, and decreases the traffic to the DNS server. But negative DNS replies are also cached and used for up to 15 min before it again requests the DNS Server. This waiting time can be annoying if the domain is correct and the DNS Server just were sick for a moment. The waiting time can be configured with these DWORD values:

[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Services \Dnscache \Parameters]
NegativeCacheTime = 5 (Win2k Default 300 sec)
MaxNegativeCacheTtl = 5 (WinXP/Win2k3 Default 900 sec)

Note using 5 sec instead of 0 sec to throttle the requests to the DNS Server in case a faulty application loops around a DNS Lookup.

Note to see the contents of the DNS cache:

ipconfig /displaydns

Note to empty/flush/reset the DNS cache manually (Part of WinXP Network Repair):

ipconfig /flushdns

Note to flush the Address Resolution Protocol (ARP) cache of Ethernet Addresses (Part of WinXP Network Repair):

arp -d *
netsh interface ip delete arpcache

Note to purge and reload the NetBIOS cache (Part of WinXP Network Repair):

nbtstat -R

More Info MS KB Q245437
More Info MS KB Q297510
More Info MS KB Q318803

Related Microsoft TCP/IP Version 6 (IPv6) can cause slow DNS

Credits Navas Cable Guide

Updated: 23 September 2007

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>