Web Development

Manage the DNS client cache in Windows 2000 Pro

If a lookup fails for a host because the target domain's DNS server is down, then subsequent attempts to look up the host will also fail because the failed results are cached. Learn two ways to overcome this problem.

DNS enables fully qualified host names like www.techrepublic.com to be resolved to their target IP addresses. Every time you visit a Web site, the DNS client software built into Windows 2000 Professional performs a DNS lookup of the specified host name to obtain the IP address of the target server.

The DNS client caches the results of each name lookup to speed up subsequent requests for the address. The default cache timeout is 30 minutes. If a lookup result is longer than 30 minutes, Windows performs an external lookup of the host and refreshes the cached copy.

Although caching can improve name resolution performance, it can also affect resolution in a negative way. In addition to caching positive results, Windows also caches negative results. So, if a lookup fails for a host because the target domain's DNS server is down, then subsequent attempts to look up the host will also fail because the failed results are cached. You can overcome this problem in one of two ways: flush the DNS cache and try again when the server comes back on line, or change the cache timeout.

To change cache timeout, open the Registry Editor and add the DWORD value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\DnsCacheTimeout. Set the value of DnsCacheTimeout to the number of seconds you want entries to be cached.

To flush the DNS cache altogether, use the following command at a console prompt:

ipconfig /flushdns

Note: Editing the registry is risky, so be sure you have a verified backup before saving any changes.

Miss a column?

Check out the Windows 2000 Professional archive, and catch up on the most recent editions of Jim Boyce's column.

Want more Win2K tips and tricks? Automatically sign up for our free Windows 2000 Professional newsletter, delivered each Tuesday!

0 comments

Editor's Picks