Saturday, January 20, 2007

Program independent ad blocker

Spyware and adware are a problem, but you can easily block them. There are a slew of ad blockers around the internet that you can you, but very few people realize that there is one practically built into their computer (PC's). The trick lies in editing a file within windows. I will walk you through the quick process of doing it yourself:

[Image: Create shortcut]Step 1: Create a shortcut to the hosts file
The hosts file is used by your computer as the primary source of IP's for domain names. If a site is not on the list, it is then asked for on your ISP's DNS server. If the address is there, your computer will use the IP assigned to the domain.

While you surf the internet, it is very likely that you will come across ad serving sites that you would care to block. In order to make things easier, you should create a shortcut to this file. To do so, right click and choose shortcut (as illustrated at right). You will want this shortcut to point to the file: C:\WINDOWS\SYSTEM32\DRIVERS\ETC\hosts

[Image: Hosts file]Step 2: Add websites to the list
This part is somewhat different depending on the person. If many people use the same computer, you should also check with them before going too crazy because this will affect them, too. The syntax is simple. In the example below, I block the domain and the zero signifies a "null" address, if you are doing this as a business thing, you can point this to an IP to display a message instead of an "error connecting" page. Each entry should be on a new line. Example:

If you want, there are sites that have ready-made host files for blocking known ad sites. This site has a downloadable file with everything you need.

Optional: (with FireFox)
After you are done with the hosts file, you can use stylish or greasemonkey with FireFox to clean up sites. Some sites have styling just to frame the ads, but with these extensions, you can remove some of that to make it look better.

Note: There is an occasional time (very rare) where sites will cease to work correctly when certain ad sites are blocked. This can be easily solved by commenting the site out if needed, and removing the comment later.

This was my first article written as a step-by-step like this. Some feedback would be nice.


8:22 PM | Posted by mike | 0 comments posted below


Post a Comment

Barack Obama for President