Putting a Stop to Internet Marketing - Modified HOSTS File

Article Index

Modified HOSTS File

Understanding how internet traffic works is essential in determining ways to mitigate the behavior of your computer on the net. When you enter a URL such as www.antimidas.net into your browser and click Go, you set off a chain of events. Computers are addressed by numbers and only referenced by names. Think of it as an over-glorified telephone switching network. You don’t look people up in a phone book by number. You look for them by name because it names are easier to remember than numbers. Computers function in the same manner.

Your computer first looks at a file on your computer called HOSTS to see if it can find out what IP address is associated with the requested site. This is like a little black book. If it does not find an entry, it searches for local DNS servers – similar to the yellow pages you store under your coffee table. If it still cannot find the number, it forwards the request to your ISP or an outside DNS service in order to locate the appropriate entry – the equivalent of calling information for the number without the added cost.

The fastest way to block a website is to modify the little black book. You effective provide your browser with a wrong number rather than no number so that it stops looking anywhere else for the information. One such list that I use can be found here. The site provides instructions for locating and replacing the file on your computer. This is a completely manual process. You will need to revisit the site periodically to download any updated HOSTS file and replace the old one. As a general rule, I only do this when I notice an increase in the number of ads getting through.

The list is comprehensive. The creators not only index known ad providers. They also have added entries to prevent most known trojans and spyware from being installed on your computer. It is well worth the effort.

You will notice that the file refers all of the ad sites to an IP address of This refers back to your local machine. If you have the knowhow, you can install a web server on your local machine and put a blank page on it so that all blocked ads simply appear as whitespace. I have mine on a separate server, so I changed every occurrence of the loopback IP address to the IP of the server hosting the page. It is important to keep the first entry of localhost intact.