Windows

Hosts

What is the Hosts File?

The hosts file contains a list of IP Addresses and web page addresses:

127.0.0.1 www.webpageaddress1.com
127.0.0.1 www.webpageaddress2.com
127.0.0.1 www.webpageaddress3.com
127.0.0.1 www.webpageaddress4.com
127.0.0.1 www.webpageaddress5.com

Whenever your computer attempts to access the internet, it has a look at the hosts file.

If it finds the web page address that it is looking for, then it will go to the associated IP address to load the page.

If the web page address is NOT found in the hosts file, then the computer will look for it on the internet.

This can be very useful as the hosts file can be made to contain just web pages that you do not want to visit (e.g. adverts) and to redirect them to IP address 127.0.0.1 which is the local computer.

Rather than getting the site you will then get a message Page not found - connection failure.

Where is the Hosts File?

This depends on the operating system:

Operating System:Location:
Windows 7 C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Note: In the 64-bit version the HOSTS file is located at:
C:\WINDOWS\SYSWOW32\DRIVERS\ETC
Windows VistaC:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows XP C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K C:\WINNT\SYSTEM32\DRIVERS\ETC

The name of the file is just HOSTS.

Where can I get a new Hosts File?

Before replacing the hosts file make a copy of the existing one.

A new hosts file can be downloaded from http://www.mvps.org/winhelp2002/hosts.htm (direct link to zip file).

The hosts file can now be unzipped and copied to the required location.

Note that large hosts files (such as this) can cause the computer to slow down considerably. To fix this on a standalone home computer (this fix will NOT work if the computer is part of a network):