+++Basic Hosts File Banner Ad-Blocking Tutorial+++ by Xierox

This is a basic Ad-Blocking Tutorial written
for those who are annoyed by banner ads.
This will will not cover popup ads.

TABLE OF CONTENTS:
- Address Resolution
- The Hosts File
- Spybot: Search and Destroy

*** ADDRESS RESOLUTION ***
When you type in a URL, your computer queries your ISP's DNS (Domain Name Server) server for the IP Address of the website you want to see. For example, when you try to go to Google.com, your computer asks the DNS server for Google's IP address. The DNS Server gives your computer Google's IP and then your computer finds and loads the website located at that IP address. (In this case, it would be Google's website that it would load.)

Note: 127.0.0.1 is the loopback address. Basically this means it *always* refers to your own computer. So, if you ping 127.0.0.1 it will ping your own machine.

*** THE HOSTS FILE ***
The hosts file is a plaintext file on your computer used to perform local address resolution. Simply put, this means that you can manually enter host names (i.e. google.com) with their corresponding IP address (i.e. 216.239.57.99) and your computer will no longer query a DNS server for that website's IP (in this case Google's IP). It will use the IP address that you have entered into the hosts file.

Example:
Let us say that I open up my hosts file and type in the following: "127.0.0.1 google.com" (no quotes) and then click save. From now on, every time my computer tries to access google.com it will find the entry I put into the hosts file (127.0.0.1 google.com) and my computer will assume Google's IP is 127.0.0.1 and it will not query my ISP's DNS servers for Google's IP. Because it believes Google's IP is 127.0.0.1 the computer will not be able to load the site.

HOSTS FILE LOCATION
The Hosts file is located in different spots, depending on your operating system. You can either perform a search for "hosts" (no extension) or find it in the spots listed below:
Windows XP = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC
Win 98\ME = C:\WINDOWS

Once you have found the hosts file, you can open it in any simple text editor, such as Notepad. Instructions are located in the file, but as they can be somewhat cryptic, I will give the basics here.

USING THE HOSTS FILE
Using the hosts file is extremely easy. If I wanted to make my computer search for Google's website at the IP "127.0.0.1" every time I typed in google.com, then I would add the following:
127.0.01 google.com
Any time my computer tried to access anything from google.com it would search for the content at 127.0.0.1. And because Google does not have that IP address, the attempt will obviously fail and nothing will be loaded.

ANOTHER EXAMPLE
DoubleClick.net is a huge internet advertising server. You may run across a couple of their ads a day. By adding the following to your hosts file, you can stop seeing their banner ads:
127.0.0.1 doubleclick.net
The result: Any time that your computer tried to load content (such as a banner ad, or a picture) from doubleclick.net, it will try to find that content at 127.0.0.1. Because 127.0.0.1 is your computer, the content will not load.

PUTTING TO PRACTICAL USE
Let's say you are browsing a website and you notice a lot of banner ads. You also notice that quite a number of them come from one website in particular. (Let us use the example of g.msn.com) What you can do it open up the hosts file, type in "127.0.0.1 g.msn.com" and then save it. Then, every time your computer tries to load an advertisement from g.msn.com, the computer will not be able to find the advertisement and thus, will not be able to show it.

WARNING: Be careful adding sites you *use* to the hosts file. If their IP address ever changes (and you have the old one in the hosts file) the site will no longer load until you correct the mistake.

Since there are hundreds upon hundreds of these advertising networks, it is almost impossible for you to manually block them all by yourself. Thankfully, people have worked together to create lists of the bigger advertising networks for our use. Using just one of these lists can cut the number of banner ads you experience in one day easily in half. My favorite lists is http://www.mvps.org/winhelp2002/hosts.htm
Download the list and copy everything in it into your hosts file. Save your hosts file.

*** SPYBOT ***
One of the most overlooked tool of Spybot: Search and Destroy is its Hosts File section. Spybot comes bundled with its own list of hosts which it can block. It helps with both ads and spyware. To turn on this feature:
Make sure you're in Advanced Mode. (Mode -> Advanced Mode)
Click "Tools".
Make sure there is a checkmark next to "Hosts File" on the right. If there is no checkmark, put one there.
Click on "Hosts File" on the left.
Click on "Add Spybot-S&D Hosts list".

PROTECTING THE HOSTS FILE
Spybot can also lock the host file from changes so that malicious programs cannot change your hosts file and hijack it. To turn on this helpful feature:
Make sure you're in Advanced Mode. (Mode -> Advanced Mode)
Click "IE Tweaks".
Make sure there is a checkmark next to "Lock Hosts file as read only as protection against hijackers" on the right. If there is no checkmark, put one there.

Enjoy. :-)

Well, that's about it for now. If you have any suggestions or comments feel free to private message me or to post here! I enjoy (and need!) feedback!

- Xierox