Speed Up Web Access With a HOSTS File

There's another way to speed up DNS -- by creating or editing a local HOSTS file on your own PC that contains URLs (also called hostnames) and their corresponding IP addresses. Windows will first look there to see whether 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 should find an existing HOSTS file in C:WindowsSystem32DriversEtcHOSTS in both Windows XP and Windows Vista. (In some versions of Windows, it may be located in C:WinntSystem32DriversHOSTS). The file has no extension; it is named only HOSTS. If you don't find one, create it in Notepad.

Open the HOSTS file in Notepad and enter the IP addresses and hostnames of your commonly visited Web sites, like this:
65.221.110.98 computerworld.com

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. When you're finished editing the file, save it to its existing location.

Make sure to check your HOSTS file regularly and keep it up-to-date, or else you might deny yourself access to certain Web sites. For example, if www.computerworld.com 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.


Archives