Using hosts file to block Online Ads
Posted on 8:02 PM, under ad blocking, ad filtering, point of view, tools
I think most of us will agree on this. Online ads make browsing a nightmare. Well, they make a lot of content free too but at times I felt like I was browsing just ads.
And that's not it. Most of the time browsers are busy downloading these ads and we think Internet is really slow. So, I thought it's time to give it a break and make Internet not suck. Read on if you find yourself in the same boat. :)
There are plug-ins for Firefox and IE to block ads but I use Opera. Opera has inbuilt content blocking but that is too much to do as there are a zillion ad servers out there. At times I have to use FF or IE too and this leaves me managing three different applications to block ads. On top of that, putting a plug-in in the pipeline is again adding one more step before you can see the content. And then you have to keep updating them for new releases. Not a good idea, I'd say.
Another way is to use hosts file. Description of hosts file from wikipedia:
The hosts file is a computer file used to store information on where to find a node on a computer network. This file maps hostnames to IP addresses. The hosts file is used as a supplement to (or instead of) the domain name system on networks of varying sizes. This file is (unlike DNS) under the control of the user who is using the computer.
There is a lot of information available on net which you can use to make it work. In a nutshell, here is what you need to do:
- Download a hosts file which has updated lists of ad servers. I'm using the one from here and added few missing servers. Can you believe this list has around 6000 entries already? And if you follow the link, please don't try those shock sites. :( More hosts files can be found here.
- Create a backup of your existing hosts file. (just give it an extn say .old.) On Vista, hosts file can be found in [System Drive]:\Windows\System32\drivers\etc. See this to locate on other systems.
- Copy the downloaded hosts file in the etc folder. If you are using the site which I did then create another hosts file in etc folder and paste the contents from browser. See this if you are trying to edit the hosts file on Vista when UAC is enabled.
- And that's pretty much it. Try some ad plagued site like engadget and you should see blank space instead of ads.
- Also, don't forget to update the hosts file as frequently as you can as more and more servers will be popping out every now and then.
For those who wants to know the details and have plenty of time to spend :), here are the links:
- Ad Filtering (Wikipedia)
- Answers for questions like What, Why, How et al
- The hosts file I'm using
- MVPS Site related to the subject.
Enjoy!
PS: The hosts file I am using and gave the link above has entries for known malware, trojans and user tracking sites too. It also has entries for ad servers like yahoo, msn and others which can make some sites behave unexpectedly. Please see inline comments on the site.
