Monday, September 8, 2008

Blocking ads on webpages using hosts file

If the adblock plus extension is the only thing holding you back from using google chrome instead of firefox, Here's a simple solution for the same
if you are using windows


Just open this file:
c:\windows\system32\drivers\etc\hosts(assuming your windows is in c drive)
in any plaint old text editor maybe notepad
assuming your windows is in c drive
Now get a list of various adservers along with ipaddresses commonly used to supply ads for eg. here is one:-

http://www.mvps.org/winhelp2002/hosts.txt

copy all the entries from here and copy it to your own hosts file, you may want to keep the existing entries.


Thats it now no more ads will be served on your webpages.

For linux users edit the hosts.conf file in etc directory


You can also get the same hosts file here:
http://www.mvps.org/winhelp2002/hosts.zip

just extract the same to overwrite your original hosts file
P.S if you get empty pages or connection timed out on any site you wish to browse,just find the correponding entry in the hosts file and remove the same

No comments: