Learn What IT Pros Need to Know About Windows 11 - August 24th at 1 PM ET! Learn What IT Pros Need to Know About Windows 11 - August 24th at 1 PM ET!
DNS

How can I disable the caching of failed DNS lookups in Windows 2000/XP/2003?

Windows 2000/XP/2003 added the ability to cache DNS lookup results in the client’s cache. This cache can be viewed by typing ipconfig /displaydns in the command prompt:

Windows IP Configuration

 ddlnetwork.net
 ----------------------------------------
 Record Name . . . . . : ddlnetwork.net
 Record Type . . . . . : 1
 Time To Live . . . . : 13445
 Data Length . . . . . : 4
 Section . . . . . . . : Answer
 A (Host) Record . . . : 67.159.5.63

 Record Name . . . . . : ns1.gothosted.com
 Record Type . . . . . : 1
 Time To Live . . . . : 13445
 Data Length . . . . . : 4
 Section . . . . . . . : Additional
 A (Host) Record . . . : 67.159.5.63

 kona3.kontera.com
 ----------------------------------------
 Record Name . . . . . : kona3.kontera.com
 Record Type . . . . . : 1
 Time To Live . . . . : 3161
 Data Length . . . . . : 4
 Section . . . . . . . : Answer
 A (Host) Record . . . : 208.185.211.88

 Record Name . . . . . : ns.above.net
 Record Type . . . . . : 1
 Time To Live . . . . : 3161
 Data Length . . . . . : 4
 Section . . . . . . . : Additional
 A (Host) Record . . . : 207.126.96.162

 Record Name . . . . . : ns3.above.net
 Record Type . . . . . : 1
 Time To Live . . . . : 3161
 Data Length . . . . . : 4
 Section . . . . . . . : Additional
 A (Host) Record . . . : 207.126.105.146

 dns.stack.net
 ----------------------------------------
 Record Name . . . . . : dns.stack.net
 Record Type . . . . . : 1
 Time To Live . . . . : 2644
 Data Length . . . . . : 4
 Section . . . . . . . : Answer
 A (Host) Record . . . : 217.73.194.98

and so on.

Sponsored Content

Read the Best Personal and Business Tech without Ads

Staying updated on what is happening in the technology sector is important to your career and your personal life but ads can make reading news, distracting. With Thurrott Premium, you can enjoy the best coverage in tech without the annoying ads.

While being a good idea as this lowers the required amount of DNS queries on the LAN and to the ISP’s DNS, whenever a query returns a negative answer (i.e. the answer was “I don’t know”), the client also caches this information.

If this answer was due to a misconfigured entry in DNS, and you, as administrator, have fixed it, it won’t matter for that specific client, as the negative answer is already stored in its cache. It’s like the client is telling itself “why should I bother asking again, I know that the DNS doesn’t have an answer for me”…

You can manually clean this cache by running the ipconfig /flushdns command from the command prompt:

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

But in order to totally avoid this situation, you could simply configure the client to not cache any negative DNS lookup results.

To do so follow these steps:

  1. Open Registry Editor.
  2. In Registry Editor, navigate to the following registry key:
     lang="reg">HKEY_CURRENT_USERHKEY_CURRENT_USERHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
  3. Create the following value (DWORD):
    NegativeCacheTime
    and give it a value of 0 (zero).

    Note: As always, before making changes to your registry you should always make sure you have a valid backup. In cases where you’re supposed to delete or modify keys or values from the registry it is possible to first export that key or value(s) to a .REG file before performing the changes.

  4. Close Registry Editor.

Done!

Links

Rename or Delete Special Folders

Related Topics:

DNS
BECOME A PETRI MEMBER:

Don't have a login but want to join the conversation? Sign up for a Petri Account

Register
Comments (0)

Leave a Reply

Register for Advanced Microsoft 365 Day!

GET-IT: Advanced Microsoft 365 1-Day Virtual Conference - Live August 24th!

Join us on Tuesday, August 24th and hear from Microsoft MVPs and industry experts about how to take advantage of Microsoft 365 at a technical level and dive deep into the features and functionality that will make your environment more secure and compliant.

RSVP Now

Sponsored By