What is a host file ?
The host file is a computer file which maps hostnames to IP address of web server. Unlike DNS networks it can be controlled by the system administrator.The host file has no extension but can be accessed using normal text editors like notepad.
Importance of the host file
The host file can be used to block websites and is vulnerable too since it can be used by malicious programs to redirect visitors of legitimate sites to spyware sites. So even if you type the correct url in your browser if your host file was modified then your account information could be compromised by redirecting to a malicious (phishing) site.
Location of the host file
Press Win key + R and then type the following location
%SystemRoot%\system32\drivers\etc\ is the default location.
Editing a host file
For windows versions older than Vista you can edit it just by opening it with notepad.But starting with Vista , if UAC (User Account Control) is enabled, then use this guide.
You can make use of host files to block ads,third party counters etc.
Ex: 127.0.0.1 ad.doubleclick.net adding this entry to the host file blocks files from doubleclick server.
For more examples visit : http://www.mvps.org/winhelp2002/hosts.txt
Famous Security Vulnerabilities
The widespread worm Mydoom.B blocked users from visiting sites regarding computer security and antivirus software and also affected users’ ability to access the Windows Update website by modifying the host file.
But you should not depend only on host files to block websites since a simple trace route could reveal to the user that the particular website is blocked using the system’s host file.
The following site has been blacklisted using host file. The user can perform a simple traceroute to find out if it is blocked via hosts file.
So I recommend you to use appropriate software for blocking websites or give them normal user accounts so that modification of host file is impossible.To protect your host file make it read only.Hence we can block websites without any software installation just by making an entry in the hosts file.