Block Advertisement in Websites

Are you fed up with Ads like Free Screensavers,Smileys etc on some websites making your connection slow because ads alone take much bandwidth and time to download than the actual Content which you are looking for. Here is a method to block such IMAGES from showing up in Windows.

In windows there is a file called HOSTS which contains a list of Hostnames with its IP address. It is used to bypass the DNS server. This file is loaded into memory when Windows starts. Actually when a Browser (For eg. Internet explorer) requests a Website,then first this hosts file is checked whether the URL requested is present in the list. If it is not there then it connects to DNS Server to find out the IP address. This is highly useful if you visit some sites on a regular Basis. (For. Eg: Yahoo! Mail) Instead of connecting to DNS server everytime to get the IP address if manually the IP address is found out using WHOIS and then entered in the list then few milliseconds can be saved since Windows first checks HOSTS file and it finds that the entry http://mail.yahoo.com (In our example) is present and gets the entry from the file and directly connects to that IP address( In Our eg. :209.73.177.115)

This file is present in different versions of Windows in the following Directories:
Windows XP = C:\WINDOWS\SYSTEM32\DRIVERS\ETC
Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC
Win 98/ME = C:\WINDOWS
Search for the file and open it with any text editor like Notepad. You can find content similar to this:

# Notes: the browser does not read this "#" symbol #
# You can create your own notes, after the # symbol #
# This *must* be the first line: 127.0.0.1 localhost #
127.0.0.1 localhost

Here the first uncommented line shows that the IP address of localhost is 127.0.0.1. This is called a LOOPBACK ADDRESS which points to ones own Computer i.e, if type localhost it tries to connect to your own computer. In other words your computer’s IP address is 127.0.0.1 unless it is connected to a network. Since there is server installed on your computer( Normally) IE shows that “Cannot Find Server”.
This Trick can be used to block Advertisement from any site,not only ad site but also you can restrict users from accessing a particular set of sites.For eg: You can prevent your children from visiting Inappropriate sites,Block Images from a site for faster loading of the site and to save bandwidth.This can be done just by entering the site which must be blocked in the HOSTS file with an IP address of 127.0.0.1 Actually the IP address of that site is different which is got by a DNS request, but we give false information to the browser by giving Loopback address through which it tries to connect your own computer and fails in getting the data. This way sites can be prevented by Accessing. For eg:
# Notes: the browser does not read this "#" symbol #
# You can create your own notes, after the # symbol #
# This *must* be the first line: 127.0.0.1 localhost #
127.0.0.1 localhost
127.0.0.1 www.msn.com

This is for example. Replace www.msn.com with any website you want to block.Similarly enter one by one the websites which you want to block.
So you have now learnt how to block a site from accessing in Windows. For greater security make the HOSTS file READ ONLY so that only you (Admininstrator) can modify it.
Now let us learn some Basics about Ads. Ads in websites are in the form of Banners, Pop Ups which are usually images (Offcourse now-a-days Google’s Adsense displays are Textual which I think is Admittable since text doesnt consumes much bandwidth and is relevant too unlike those screensaver kind of ads where even if you visit Music sites it will show up,even you go to shopping site it will show up irrelvantly) These images (Banners) are hosted in a particular Server which has an addresses like http://ads.advertise.net,adserver.ancestry.com etc. So if you enter the IP address for these sites as 127.0.0.1 in HOSTS file then they are blocked and wont show up.Next question that will arise in your mind is “How would I know the addresses of such ad sites?”.Well, there is a solution, some websites gives a list of such Ad servers and some even with 127.0.0.1 mapped to such Ad servers so that you can easily copy and paste into the HOSTS file. Some even releive you from that Headache too…They provide hosts file itself to download and all you have to do is to replace the downloaded file with original Hosts file. Perform a Google Search to get a list of such sites. One such site is www.mvps.org
By this method Ads can be Prevented by showing up but Pop ups cant be stopped. But even a POP UP comes up then it will be blank and will not display any images by this method.To prevent Pop Ups you have to go for software or use Opera, Firefox browsers which are far better than Internet explorer with lots of features. Or if you want to stick to IE then use Google toolbar or any external software to block Pop Ups.

Share this on:
  • Digg
  • del.icio.us
  • YahooMyWeb
  • Technorati
  • StumbleUpon
  • IndianPad
  • Furl
  • BlinkList
  • Taggly
  • Fark
  • Ma.gnolia

Leave a comment

Name:

eMail:

Website:

Comment: