Algorithms
Electronics
File Formats
Freeware
Games Programming
Hardware/Architecture
HTML/CCS & Java/Javascript
Humour
Link Site,Library
Linux,GNU
Magazines/Books
Network Protocols
Networks
New/Latest Stuff
Programming Languages
Servers/ISAPI/ IO Completion Ports
Sound/Music and Multimedia
Source Code
Visual Basic
Windows
Winsock

Getting Rid of ads

The Problem

Everyone will have noticed that many websites, especially Search Engines and Free Webpage sites place banner ads at the top and sometimes at the bottom of webpages. These cause the pages to take longer to load, and require more data to be downloaded, which you probably have to pay for. There is also the issue of privacy, as these banners can track the user and generate a so called "click trail". This can be used to determine what your interests are and other things about yourself. By using the information encoded the URLS of some websites, your name and email address and other personal information can be gathered.

The methods that I am about to show will also limit the loss of this personal information to the ad companys. This technique is not perfect but it should get ride of the ads on most of the larger websites.

There are 2 methods of doing this and the method chosen will depend on the way you are connected to the internet. If you cannot make outgoing requests on port 80, and you have to use a proxy server you can use method 1 or otherwise you will need to use method 2. There is also one assumption to these techniques, which is that you can only block out entire web servers, and you can't just restrict it to few files on the server. This shouldn't be a problem though because you will not want to visit and of the ad companys websites anyway.

Method 1

Since the ISP blocks requests on port 80 all you have to do is to fool your browsing software into thinking that it has to connect directly to the web server instead of going through the proxy server. To do this go to where the proxy settings are configured. Below I have shown how to get to the proxy settings in Internet Explorer and Netscape, but there is nothing stopping you from doing this in other browsers if they have an Exceptions list for their proxies.

Internet Explorer 5.x

Click on the Tools Menu and select the Internet Options. Then you should click on the Connections tab. Finally Clicking on Settings if you use dialup networking to connect to the Internet. If you don't you should probably click LAN Settings.

Netscape Navigator 4.x

Click on the Edit menu and select Preferences. Then Select the Advanced Category and then Proxies. Finally click on the View button. If the View button is grayed out, then you either will not be able to use this techique or you will have to really know what you are doing.

Internet Explorer 5.0

Netscape Navigator 4.7

Method 2

For the second method you do the same as above, but you have to add an extra step in. This involves adding the domain names of the ad sites into the hosts file with those addresses pointing to you computer. The hosts file may not exist but its usual location is in the C:\WINDOWS folder. On Linux this file can be found in /etc/ . For example to block ad.doubleclick.net and ads.doubleclick.net you would put the following at the end of the file.

0.0.0.0  ad.doubleclick.net
0.0.0.0  ads.doubleclick.net

Don't forget to press enter so that there is a blank line at the end of the file. If you don't do this it may not work properly.


What does it do?

For the first method, the web browser will try to contact the web server of the ad places directly, instead of through the proxy server. Since the firewall blocks the requests on this port, the web browser will simply think that it cannot contact the site. It will still go and load other pictures on the page in the meantime so the page will load and finally the ad request will timeout.

For the second method, it will cause the web browser to try and contact your computer for the ads instead. Since you probably don't have a web server running on port 80, then the graphic will just not show up. If you do have a web server on your computer, it shouldn't be to much of a problem either because the web server will just return "404 Not Found" pages. This will cause a buildup of error messages in the log file but I don't really see this as much of a problem.

Results

I didn't conduct any timed results, but there was a noticeable speedup of pages loading from places like Hotmail. So after these modifications you should be able to go surfing with increased speed.

This also results in less data being downloaded, which may make your web surfing less expensive.

Other Uses

There is nothing to stop you from blocking other websites that you don't want to be accessed. For example you could block some of the obvious pornography websites, or sites that you don't want people who use your computer to access.

Sites you should block

ad.doubleclick.net
ads.doubleclick.net
ad.au.doubleclick.net
ads.msn.com
m.doubleclick.net
click.goto.com
adforce.ads.imgis.com

TIP: Try clicking on the above URLS and if your browsers says that it can't access them or you get a 404 error, then you have set things up correctly.

Copyright Geoffrey Smith 2000