Add a permanent entry to the DNS cache in Vista

When you add a permanent entry to the DNS cache, it will always override the information provided by the nameserver. Here are a few reasons why you might want to do this.

It's a quick and dirty workaround.
If a nameserver gives the wrong address for a domain or provides no information at all, you can still access the domain if it’s listed as a permanent entry.

It puts a stopper in spyware.
A permanent entry with intentionally incorrect information will block requests sent to the corresponding servers. This can be an effective way to prevent some web sites from tracking you, some "spyware" software from recording your personal information, and even stop some pop-up ads when you visit web pages. A list of known "tracking" hosts can be downloaded from http://www.accs-net.com/hosts/.

It improves lookup performance.
If you frequently access a particular server, and you know its IP address isn’t likely to change anytime soon, you can add a permanent entry to eliminate the initial delay as Windows looks it up. For example, add an entry for your mail server to decrease the time it takes to check for mail.

It's a shortcut for the lazy.
If you frequently access a remote server without a domain name (rather than only by its IP address), you can configure a custom domain name, for your use only, to be used as a kind of "shortcut" to the server.

Providing incorrect information here can prevent you from accessing certain remote servers. Use care when modifying the permanent DNS entry table.

Here's how to create and modify the list of permanent DNS entries:

1) Open Explorer and navigate to the C:\Windows\System32\Drivers\etc folder.

2) Look for a file called hosts (no filename extension). If it's not there, create it by going to File → New → Text Document, and typing hosts for the filename.

3) The hosts file is just a plain-text file; open it in your favorite text editor (or Notepad).

4) A standard entry looks like this:
207.46.230.218 www.microsoft.com
The first part is the IP address, and the second part (separated by a tab or several spaces) is the domain name. Keep in mind that variations like www.microsoft.com and microsoft.com aren't necessarily the same server, and represent different DNS entries. You'll need to add a separate hosts entry for each variation if you want to access them all, like this:

207.46.230.218 www.microsoft.com
207.46.230.218 microsoft.com

Using this syntax, add an entry for each domain you wish to hardcode into Windows DNS table. Note that these addresses affect your machine only; other machines, such as those in your workgroup or others on the Internet, will not be affected.

5) You may also see some lines that begin with the # character. These are comments, and they are ignored by Windows.

6) Save the hosts file when you’re done. The change should take effect immediately.





Tags: dns,drivers,spyware

Related Articles