Sunday 24 April 2011

Speed up browsing DNS (hack)

According to the headline of the article I am gonna present you some ways to speed up web browsing on your windows boxes.As you know, when you request a page your computer contacts a DNS server with the request to do the name resolution.So if your DNS server delays in resolution you will face a delay in getting to the site.So why not to speed up name resolution in order to speed up browsing…

1.First way to speed up web access is via HOSTS file which is located in the following path


Code:
C:\Windows\System32\Drivers\etc
it’s a plain-text file so you can edit it with notepad or any other editor.i think it’s straightforward.
Under the hood, windows first look this file to see whether there is an entry for the hostname and if it finds it,it resolve it itself.Unless,the request will have to go out to a DNS server wait for response which is the case we want to avoid.

2.Another way is by configuring the windows DNS cache.

Before I go on let me show you a few commands in order to configure cache manually


Code:
C:>net start dnscache
It will start your local dns cache .

Code:
C:>ipconfig /flushdns
It will clear your dns cache and display the results for you.

If you want to see what is in your local dns cache at this time, issue this command


Code:
C:>ipconfig /displaydns
Ok go on…

when you want to go to a site, Windows first looks in its local DNS cache, to see whether the DNS information is contained there. That way, if it finds the information locally, it doesn't have to look in your HOSTS file or query a remote DNS server to find IP information.DNS cache contains entries in which DNS lookup succeeded and entries in which the lookup failed. when Windows looks in the cache and finds such an entry, it gives you an error message without bothering to go out to the site to see if it’s reachable.In fact, windows cache these data for five minutes but we cannot be sure that we won’t run into problems.i am sure you would like to get over this problem that may lead you to confusion ..me too…

we can solve it by using a Registry hack…
lets hack a bit..

Run the Registry Editor and then go to:


Code:
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 DWORD determines how much time, in seconds, to keep falied entries in the DNS cache.i don’t want these falied entries in my cache so I set DWORD’s value to 0(zero).
From now on no buggy data in our DNS cache…
After that I am sure that you browse on the fly…without any lag…

No comments:

Post a Comment