Increase DNS Cache In Windows Vista / Windows 7 For Faster Web Browsing



Whenever you go to a website, Windows DNS Cache has to look up the IP address where that website is located. First it checks to see if it’s in your cache before asking the DNS server over the Internet for the IP address.The cache contains both negative and positive entries.

Positive entries are those in which the DNS lookup succeeded and you were able to connect to the Web site. When Windows looks in the cache, if it finds a positive entry, it immediately uses that DNS information and sends you to the requested Web site.

Negative entries are those in which no match was found, and you end up getting a “Cannot find server or DNS” error in your browser. Similarly, when Windows looks in the cache and finds a negative entry, it gives you the error message without bothering to go out to the site.Negative entries can lead to problems. When you try to make a connection to a site that has a negative entry in your cache, you’ll get an error message, even if the site’s problems have been resolved and it’s now reachable.

The items in the cache do not stay there forever, and are constantly making room for more recent addresses you visited. Increasing the size of the DNS cache in Windows Vista and Windows 7 will allow for faster web browsing, especially if you frequently view the same websites. Edit some registry values to achieve this.

Here's how:
  • Click on Start -> choose Run -> type in regedit -> press ENTER.
  • Locate and then expand the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters
  • Go to New > DWORD (32-bit) Value.
  • Name it as CacheHashTableBucketSize
  • Double-click into it and enter the value 1 (in Decimal)
  • Also create the following DWORD values with the following values also in Decimal:
NegativeCacheTime = 0
CacheHashTableSize = 384
MaxCacheEntryTtlLimit = 64000
MaxSOACacheEntryTtlLimit = 301

To make the changes to take effect, flush your Windows DNS cache by issuing the command ipconfig /flushdns at an elevated command prompt (run CMD as administrator). The command will flush your DNS cache — all the entries, both positive and negative, will be flushed — and it will be empty until you start visiting Web sites.

Restart your computer for the changes.

Here is the example on "DNS Cache Parameters" in registry looks like after above tweaks been done.


To undo the tweaks, just delete all those registry keys that you've created and restart your computer.

It works flawlessly in Windows Vista and 7, but you could try this on Windows XP too to see if it work.

1 Comment:

  1. Can we increase the cache sizes even more? Do you know the maximum entries possible, and would you discuss the ramifications of larger values?

    ReplyDelete