Home > tech > Block ads with your hosts file

Block ads with your hosts file

July 24th, 2009

I’ve always been pretty tolerant of online ads; they’re kinda required for the interwebs to operate. Lately, ads have been appearing in RSS feeds. Big ads. Ads with embedded movie files in them. Nasty stuff…

Ok, I get that the author needs to get some cash wherever possible. Maybe even more so in an RSS feed than on the site itself, as people tend not to visit the site when browsing via an RSS reader.

I stumbled across this custom hosts file (15,000+ lines!) which lists thousands of known problematic and malicious websites. This will not only block ads, but also banners, third party cookies and page counters, web bugs and even hijackers.

In a nutshell, it works by telling your browser that your local machine will be serving up the ad. Of course, your machine is not hosting the ad, so your browser displays a standard 404 error where the ad should be. All this without requiring a single extension and it works in any browser and on any operating system.

Overall, it’s a tidy solution that doesn’t require you to bog down Firefox with yet another extension. It’s a shame that it’s such a manual process, requiring the user to keep checking for updates.

Disclaimer: If you don’t know what a hosts file is, I suggest you find a geek (preferably not me) to help you. If you screw this up, you’re on your own. /Disclaimer:

midbach tech

Comments are closed.