Pi's Website - Archived

Vista Q & A
Home
Common Errors
Helpful Links
Linux
Tutorial Index
Windows Vista
Contact Us
Site Map
PC & Certification Info
Tweaks
Programs
What is the Hosts File?
The Hosts file contains a list of URLs (uniform resource locators) or hosts.  It is possible to redirect certain hosts to a specified IP (internet protocol) address.  The Hosts file is commonly used to redirect known malicious URLs to the "local" address 127.0.0.1, which is obviously not the actual location, so the malicious ad, cookie, etc. will not appear.  Windows checks the Hosts file before it connects, so a good Hosts file can prevent nearly all ads from appearing in Internet Explorer, Firefox, or any other program that access the Internet.
 
This is most effective when combined with other efforts to block ads and cookies, such as using Spyware Blaster and Adblock for Firefox.
 
How can I add malicious sites to my Hosts file?
There is an excellent tutorial by Microsoft MVP Randy Knobloch here with a hosts file and instructions.
 
You can manually add entries by navigating to the following location:
C:\Windows\System32\drivers\etc
1.  Right-click Hosts and click Open
2.  Choose to open the Hosts file with either Notepad or Wordpad (recommended for larger files)
3.  Add a new line
4.  Type 127.0.0.1, press tab, and type the URL for the malicious site.  Exclude http:// (ex.  ad.adcompany.com)
5.  Save the Hosts file and close the application you used to edit it.