Windows DNS Settings for Internet Connection
What is DNS?
The main technology behind the Internet is the Internet Protocol (IP). TCP is another important protocol that enables reliable file transfer and e-mail exchange. Together they are often referred to as the TCP/IP protocols, the basis for the Internet and many wide area networks and local area networks.
Since working with IP addresses is not practical for us humans, we use ‘normal’ names on the Internet that are easier to remember. Of course these names still need to be translated into the actual IP addresses of the many computers and servers connected to the internet. One important aspect of this name translation is the Domain Name System, or DNS.
The DNS is based on different network components exchanging information about the IP numbers. This help to route internet traffic in the most efficient way. DNS information is stored in routers, servers and even in local computers. Yes, also in your local PC if you are running a Windows 2000 or later operating system. The reason for this is that the buffering or caching of this information helps speed up the internet connection. The less time there is spend on finding out which address belongs to a name, the quicker it can be send. This resolver cache as it is called, allows IP addresses that are in the local cache to be used directly without the need to do a name lookup again.
So the DNS is certainly something to consider in order to solve problems with the internet connection or with Windows 2000/XP/Vista in a network. You can also optimize the DNS settings in Windows XP to speed up your Internet connection.
Maximize Internet Speed
Using the Windows registry, you can optimize your DNS configuration settings for maximum performance. Cache size and cache refresh frequency influence the PC performance. These settings will speed up you internet connection if you are running Windows 2000, Windows XP or Windows 2003 server.
- Open up the Windows Registry Editor by clicking Run in the Start menu and typing regedit. Then click OK.
- Next, browse to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Dnscache\Parameters
- If not existing, create the DWORD value “CacheHashTableBucketSize” and assign it a value of 384.
- If not existing, create the DWORD value “CacheHashTableSize” and assign it a value of 6400.
- If not existing, create the DWORD value “MaxCacheEntryTtlLimit” and assign it a value of 301.
- If not existing, create the DWORD value “MaxSOACacheEntryTtlLimit” and assign it a value of 300.
- Close the Registry Editor.
- Reboot your computer for the settings to take effect.
These settings increase the amount of storage for the DNS cache which will reduce the need for DNS queries and as a result speed up the internet connection.
Internet Problem Solving
Problems with locally cached DNS entries can also happen. Incorrect information can result in browsing errors and internet connection errors. First of all you can inspect the Resolver cache on your computer by opening a command prompt and typing: ipconfig /displaydns
This command will show all the entries in the cache and if you know what to look at, it can help you analyze name resolution problems.
If you simply want to clear the cache and force the name lookup over the internet, open a command prompt window and type: ipconfig /flushdns
Using the Windows Registry, we can control further aspects of the DNS caching on the computer. There are settings for both positive and negative DNS responses that can be changed. The settings reside in the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Dnscache\Parameters
For positive responses there is a DWORD Value named “MaxCacheTtl”, which controls the time a positive entry is stored. The default value here is 1 day, which can be shortened in many cases since ISP’s refresh there DNS entries faster than before. Changing it to a value of 14400, which is 4 hours, is valid in most cases. For Windows 2000 this entry is called “MaxCacheEntryTtlLimit”.
If you want to disable positive response caching, you can set the value to 1. This will ensure that all domain name translations are queried over the Internet. This can be good for problem analysis, but keep in mind that this will have a negative impact on the internet connection speed. The queries take time in itself and the actual internet transfer has to wait for the name/IP translation.
For negative responses the DWORD Value is named “MaxNegativeCacheTtl”. This setting specifies how long negative entries are kept. The default is 15 minutes (900 seconds), which can be changed to 0 if you do not want to cache negative responses. For Windows 2000 this entry is called “NegativeCacheTime”.
In addition you can set the values named “NegativeSOACacheTime” and “NetFailureCacheTime” to zero (0).
Especially for Windows 2000 (or W2K), there is another setting you should consider. The DWORD Value named “QueryIPMatching” can be used to control if W2K checks if a IP response is received in reply to a request. If not it should be ignored. If you set this parameter to 1 the matching will take place. If set to 0, it will not. If the matching is not activated, your computer can receive (and accept) invalid DNS records, in effect redirecting traffic. This setting should be added in the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Tcpip\Parameters
Hi Kyle,
Thanks for clarifying, and for some great tips….
Keep up the good work
;)
@AndyC – They are decimal. It is indeed not specified, but in HEX I would have written the numbers with the “0x” prefix.
Thanks for asking.
Under the heading “Maximize Internet Speed” are the new DWORD values in decimal or hex?
They look to be decimal but it is not made clear which number base.
If one were to access the DNS cache registry section you’ve mentioned on XP Home, without any previous changes ever being made, is there any reason why the DWORD values MaxCacheTtl and MaxNegativeCacheTtl wouldn’t exist by default?
I’ve created those entries on my operating system (XP) and set values, but the changes are never reflected when scanned by a PC check-up program I occasionally run. Any thoughts are welcome…nice, informative webpage :)