Jul 192008

This can be done by editing a file called Hosts used by MS TCP/Ip for locating IP addresses for typed urls .What happens is Windows keeps tracks of IP address of sites visited by you in this file so it wont have to query the DNS service every time you open the website .. When you put an address in the address bar the address is first resolved to an IP address .. So Window keeps this file to list known IP addresses.

What we will do is to put a for each site you wanna block like common ad servers and spysites .. When request to this site is found Windows will search for their entry in the Hosts file and it will found this ( address and it will try to connect this site which is your Localhost address .. So it wont find the ad images and ad popups and the like .. Your computer will then give up calling the ad server and no ads will be loaded, nor will any tracking take place. Your choices for blocking sites are not just limited to blocking ad servers. You may block sites that serve advertisements, sites that serve objectionable content, or any other site that you choose to block.

This HOSTS file is located here:

Windows 95/98/Me c:\windows\
Windows XP c:\windows\system32\drivers\etc\
Windows NT/2000/ c:\winnt\system32\drivers\etc\

This Hosts file doesnt have any extension .. You may find Hosts.sam in Win 98 but it is only a dummy file … You should save the Hosts file corresponding to ur Operating System …

So a small example Hosts file :

# localhost: Needs to stay like this to work localhost 123banners.com ad.adsmart.net ad.ca.doubleclick.net ad.de.doubleclick.net ad.doubleclick.net ad.es.doubleclick.net ad.fr.doubleclick.net ad.free6.com ad.it.doubleclick.net ad.iwin.com ad.jp.doubleclick.net ad.kr.doubleclick.net ad.linkexchange.com ad.linksynergy.com
# and so on …

The # sign denotes a comment ..

  4 Responses to “Howto Block Unwanted Content From the Net in XP/2000”

  1. Want to know any trick of blocking content
    like – Porn
    i mean to say like host file is there any file in windows to block site by words only.

  2. good job! ive used this to block certain sites that very disturbing…. really save my time…. even though i think it’s a very dangerous thing to do by average people… copy the real file first as precaution…

  3. hi..nice articel. I tried the method and it’s working. However, if i wanted to disabled back the function. I opened back the hosts file but the site that i block, did not exist in the file. what the steps that i need to do. Thanks

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>