The HOSTS file
is a text file that has no extension and can be viewed using notepad. At the top is an explanation of the simple syntax. Each line is an IP address, a domain name, and an optional comment placed after a #
sign. A HOSTS file maps an IP address to a name. In Windows XP, 127.0.0.1 localhost
is the universal IP address of all local computers and is the standard hostname given to the address of the loopback network interface which refers to the local computer only.
The original purpose of HOSTS files was to map the proper address to a site's name but now its also used for blocking purposes. The loopback address
is used to stop web ads from displaying because 127.0.0.1 indicates home (the location of your computer) and whatever is redirected home will not leave the system. Anything that appears in your HOSTS file without an #
at the beginning, except from the "127.0.0.1 localhost" line, should be viewed with suspicion. In Windows Vista the IPv6
localhost is ::1 localhost
by default. To learn more about this, you can read Hosts File FAQS
and LMHosts and Hosts files
ē To view the folder containing your Hosts file, go to Start > Run and type: %windir%\system32\drivers\etc\
The Hosts file has as no extension. The easiest way to access and view the contents is by using notepad.
- Double-click on the HOSTS file.
- A message will appear saying Windows can't open the file or Choose the program you want to open this file.
- Scroll down the list of programs until you see Notepad.
- Select it and click OK.
ē To view the Hosts file in Notepad automatically, go to Start > Run and type: notepad %windir%\system32\drivers\etc\hostsSpybot Search & Destroy: HOSTS file viewer