Tweak Dns Settings: Faster Net Access (?)

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Tips and Tricks RSS
Next:  Delta Force: Extreme Demo Released  
Author Message

Joined: Jan 02, 2005
Posts: 1511

PostPosted: Tue May 17, 2005 8:18 pm    Post subject:

Caveat Emptor!
Basics of DNS:
You use the Web by typing in hostnames such as, but web servers and Internet routers can't understand plain English words, so they need those letters translated into numeric IP addresses. Whenever you type in a hostname, such as, it needs to be resolved to its IP address, such as DNS servers provide that name resolution automatically and behind the scenes as you surf the Web.  There are several ways you can hack your DNS settings so that you can get faster web access.

Speed Up Web Access with a HOSTS File
It takes time to send your request to a DNS server, have the server look up the proper IP address to resolve the name, and then send the IP address back to your PC. You can eliminate that delay by creating or editing a local HOSTS file on your own PC that contains hostnames and their corresponding IP addresses. When you create one, XP will first look into the HOSTS file to see if there's an entry for the hostname, and, if it finds it, it will resolve the address itself. That way, you won't have to go out to a DNS server and wait for the response before visiting a web site. The HOSTS file is a plain text file you can create or edit with a text editor like Notepad.
You'll find an existing HOSTS file in C:\System32\Drivers\Etc\HOSTS. The file has no extension; it is named only HOSTS. Open it in Notepad and enter the IP addresses and hostnames of your commonly visited web sites, like this:
Each entry in the file should be on one line. The IP address should be in the first column, and the corresponding hostname in the next column. At least one space should separate the two columns. You can add comments to the file by preceding the line with a #, in which case the entire line will be ignored by the file, or by putting a # after the hostname, in which case only the comment after will be ignored. You might want to comment on individual entries-for example:        #still in beta
When you're finished editing the file, save it to its existing location.
WARNING: Make sure to check your HOSTS file regularly and keep it up to date, or else you may deny yourself access to certain web sites. For example, if the web site were to change its IP address, but your HOSTS file kept the old, incorrect address, your browser would not be able to find the site, because it would be given the wrong addressing information.

Adjust XP's DNS Cache Settings
As a way of speeding up DNS, when you visit a site, XP puts the DNS information into a local DNS cache on your PC. So, when you want to go to a site, XP first looks in its local DNS cache, called the resolve cache, to see whether the DNS information is contained there. That way, if it finds the information locally, it doesn't have to query a remote DNS server to find IP information. The cache is made up of recently queried names and entries taken from your HOSTS file.
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 XP 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 XP 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.
You can solve this problem, though, using a Registry hack. By default, XP caches negative entries for five minutes. After five minutes, they're cleared from your cache. But if you'd like, you can force XP not to cache these negative entries, so that you'll never run into this problem. Run the Registry Editor and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters. Create a new DWORD value with the name NegativeCacheTime and give it a value of 0. (The value may already exist. If it does, edit its value to 0.) The DWORD determines how much time, in seconds, to keep negative entries in the DNS cache. If you like, you can have the entries stay alive for one second by giving it a value of 1.
After you're done editing, exit the Registry. To make the change take effect, restart your computer, or flush your cache by issuing the command ipconfig /flushdns at a command prompt.
That 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. Negative entries, however, will not be added to the cache if you've given the DWORD a value of 0.
You can also use the Registry to control the amount of time that positive entries are kept in the DNS cache. By default, they are kept for 24 hours. To change the default, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters again and create a DWORD value called MaxCacheEntryTtlLimit. (If it's already present, just edit the value.) For the value, enter the amount of time you want the entry to remain, in seconds, making sure to use Decimal as the base.
Fix DNS Problems
Sometimes when you can't connect to a web site, the cause is a DNS problem. There are things you can do to solve these problems, though. If you're having trouble connecting, to find out if DNS is a potential culprit first ping the site to which you can't connect, by issuing the ping command like this at the command prompt or Run box, like this:
If the site is live, you'll get an answer like this:
Pinging [] with 32 bytes of data:

Reply from bytes=32 time=119ms TTL=242
Reply from bytes=32 time=79ms TTL=242
Reply from bytes=32 time=80ms TTL=242
Reply from bytes=32 time=101ms TTL=242

Ping statistics for
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 79ms, Maximum = 119ms, Average = 94ms
If it's not, you'll get a response like this:
Ping request could not find host. Please check the name and try again.
If you ping a site and it's live, but you can't connect to it with your browser, a DNS problem might be the reason.

DNS TroubleShooting
If you suspect you're having a DNS problem, take the following actions:
Check your HOSTS file. If your HOSTS file contains an incorrect or outdated listing, you won't be able to connect. Even if you don't recall adding listings to a HOSTS file, it still may contain listings, because some Internet accelerator utilities edit them without telling you. Open your HOSTS file with Notepad and see if the site you can't connect to is listed there. If it is, delete the entry, and you should be able to connect.
Check your DNS settings. Make sure your DNS settings are correct for your ISP or network. Find out from your ISP or network administrator what yours are supposed to be. Then, to find out your current DNS settings, double-click on the problem connection in the Network Connections folder, choose Support → Details, look at the bottom of the tab to find your DNS servers. If they don't match what they're supposed to be, right-click on the problem connection and choose Properties. Then, highlight Internet Protocol (TCP/IP) and choose Properties. Change the DNS servers to the proper ones, or choose "Obtain DNS server address automatically" if your ISP or network administrator tells you to.
Flush your DNS cache. The problem may be related to your DNS cache, so flush it out. To flush the cache, type ipconfig /flushdns at a command prompt.
Find out if your ISP is having DNS problems. The cause may be your ISP. One possibility is that one of its DNS servers is down, and you're trying to access the down server. Ping each of your ISP's DNS servers and, if any of them don't respond, remove them from your DNS list, as outlined earlier in this hack. {extracted from here}
Tweak DNS Errors Caching in Windows 2000 / XP
Windows 2000/XP has built-in DNS (Domain Name System) caching, which basically caches resolved hostnames for faster access and reduced DNS lookups. This is generally a great feature, with the only downside that failed DNS lookups get cached by default as well... When a DNS lookup fails (due to temporary DNS problems), Windows still caches the unsuccessful DNS query, and in turn fails to connect to a host regardless of the fact that the DNS server might be able to handle your lookup seconds later.
There are a couple of different ways to tweak Windows 2k/XP not to cache failed DNS lookups:
1. You can flush the DNS cache manually, by going to Command Prompt and typing: ipconfig /flushdns
2. You can wait for the cached lookup to expire or reboot the system...
Or you can permanently solve this issue by tweaking a few Registry entries. You can simply use the patch below to modify your Registry:
winxp_dnscache.reg ( ) - patch Windows 2k/XP not to cache failed DNS entries. To install, save to your HD and double-click the filename.
winxp_dnscache_undo.inf ( ) - patch to reverse all changes made by winxp_dnscache.reg. To install, save to your HD, then right-click on the filename and chose "install" from the pull-down menu.
If you'd rather do the changes manually, and assuming you feel comfortable editing the Windows Registry, here are the related Registry entries (recommended values are highlighted in red):
NegativeCacheTime=0 (DWORD, default value: 0x12C (300 seconds), range: 0x00xFFFFFFFF seconds) Description: Determines how long an entry recording a negative answer to a query remains in the DNS cache. When the time specified in the value of this entry expires, the DNS client deletes the answer record from cache.
NetFailureCacheTime=0 (DWORD, default value: 0x1E (30 seconds), range: 0x00xFFFFFFFF seconds) Description: Determines for how long the DNS client stops sending queries when it suspects that the network is down. When the DNS client does not receive responses to repeated queries sent to any network adapter, the DNS client stops sending queries for the time specified in the value of this entry. During that time, the DNS client returns a timeout response to all queries. If the value of this entry is 0x0, this optimizing feature is disabled. DNS continues to send queries to an unresponsive network.
NegativeSOACacheTime=0 (DWORD. default value: 0x78 (120 secnds), range: 0x00xFFFFFFFF seconds) Description: Determines how long an entry recording a negative answer to a query for an SOA (Start of Authority) record remains in the Domain Name System (DNS) cache. When the time specified in the value expires, the DNS client deletes the answer record from the cache.
Note: As always when editing the Registry, a backup is a good idea, and reboot might be required for changes to take effect. {extracted from here}
If your system is working fine, then don't fiddle with any of these settings. I dare you to remember this information for those rare times when your connection problems may just resolve around system DNS handling.
Back to top

Joined: Feb 13, 2003
Posts: 9050

Location: West by god Virginia

PostPosted: Tue May 17, 2005 8:33 pm    Post subject:

Just curious. Has anyone ever did these types of tweaks on the DNS or other setting. And really noticed much of a difference. I've tried just about every tweak imaginable and tried different programs that Tweak, But i have never seen any real difference.
I'm not saying there isn't a difference, i just haven't noticed them.

P.S. Thats FormalDaHyde, it could speed up people with slight problems.
Back to top

Joined: May 06, 2003
Posts: 5006

PostPosted: Tue May 17, 2005 8:46 pm    Post subject:

I've tried numerous tweaks to my system in order to speed up my connection speed. Each tweak will work differently for each person that uses it. I've given up "registry diving" for these hacks - it just takes too much time and effort for me to test them out.

I'm toying with CableNut and it's Update right now, along with TCP Optimizer from They seem to give me the best results right now.
Back to top

Joined: Jan 02, 2005
Posts: 1511

PostPosted: Tue May 17, 2005 9:41 pm    Post subject:

If I read correctly between the lines of what FormalDaHyde is saying, I would venture to guess that may be he intended some of this information {especially} for those who are broadband-challenged or maybe even for network problems and/or troubleshooting thereof.

Oh wait, I think I am confusing Gnomes :harhar: !
Back to top

Joined: May 06, 2003
Posts: 5006

PostPosted: Wed May 18, 2005 12:20 pm    Post subject:

It's good info FDH! I've added this page to my "Tweaks" bookmark file. Thanks! (and sorry for getting off topic! Sad
Back to top

Joined: Dec 14, 2004
Posts: 108

PostPosted: Thu May 19, 2005 1:53 am    Post subject:

The Hosts File information is useless and dangerous. Having people hardcode IP addresses in Hosts can lead to pages not working. Just don't do it. This also includes tons of rambling and the DNS Failed Cache tweak mentioned twice. This does work and is the only useful thing mentioned.

Anyway just use TCP/IP Optimizer and run the reg script to disable DNS Failed Caching:
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Tips and Tricks All times are: Eastern Time (US & Canada)
Page 1 of 1

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Warning: fopen(): open_basedir restriction in effect. File(/home/adsense_reject.txt) is not within the allowed path(s): (/home/helploc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/helploc/public_html/Giga/GigaFunctions.php on line 1144

Warning: fopen(/home/adsense_reject.txt): failed to open stream: Operation not permitted in /home/helploc/public_html/Giga/GigaFunctions.php on line 1144

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/helploc/public_html/Giga/GigaFunctions.php on line 1145

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/helploc/public_html/Giga/GigaFunctions.php on line 1146