Howto's

[ Software | Samba | Ad Blocking | Linux ]

Blocking ads without additional software

By Eby

This is not an original tutorial, per se. It's more of a compilation of material that's available around the net. But then again, what tutorial isn't. This is just a quick job. I'll edit as needed. Feel free to reply with additions/mistakes, etc. We have plenty of smart people on this board, no reason we can't be getting good information from ya all. There are many ad blocking programs out there and I'm not going to go through them here (prehaps another tutorial). There are also ways to block ads in many browsers, including Opera and Mozilla. These browsers have options such as not loading images from other servers (most ad's are hosted by ad servers and not on the server you are visiting). They also have options for stopping pop-ups which is also useful. But blocking images from all external servers isn't always a good idea. I mean then you couldn't see our wonderful avatars and that would be bad. Luckily there are other options. All computers that connect to the internet (i'm sure there are exceptions) currently use DNS to resolve host names to IP addresses. When you connect to your ISP and get an IP you will also get information about DNS servers to use (presuming your not running your own). Your computer then uses these servers to find the IP's. Luckily you can make a list for your computer to check before it checks these servers. This allows you to set up your own custom hostname resolution. This is used for such things as localhost --> 127.0.0.1 which your computer uses for all local communication. But you can add whatever you want. This comes in handy cause you can point any hostname to point to your localhost. Since the speed to your own computer is quite fast and the timeout period quite quick, you save a lot of download time by specifying these hosts. For example, let's say i wanted to block all the stuff from "ads.kazaa.com". There's nothing on that server I really want to see so why waste my bandwidth trying to load it. To accomplish this I would add the following to my hosts file: 127.0.0.1 ads.kazaa.com This tells my dns resolution software that the location of the ads.kazaa.com server is on my computer. Don't bother trying to resolve it using the DNS servers. So when I load a page that requests something from ads.kazaa.com, it looks at my computer, doesn't see it and so doesn't load anything. Now this doesn't just work for browsers, it works for anything that tries to load anything from that server using that host name. Your probably wondering where this hosts file is located and that differs between OS's. Here's a small list:

Linux: /etc/hosts
BeOS: /boot/beos/etc/hosts
WinNT: c:\winnt\system32\drivers\drivers\etc\ (should be same for Win2000 and possible WinXP)
Win9x: c:\windows\hosts

*Note on Win9x: this file may not exist, you may have to create it and i'm not sure how well it works. If you have problems try the following URL: http://feh.net/adblock/ie5Win98AdblockingInstructions.html

Mac: In preferences folder create "Hosts" file (case sensitive). *Note: Supposedly there is also an option in a TCP/IP control panel to choose a hosts file. ***Macs has a different host file format than PC's, make sure you use the right kind from the site i list below.*** This may have changed with OS X since it is based on a Unix variant.

If you still can't find the files, try searching for "hosts" on your computer. Also check the reference URL's I list at the end of this tutorial. Alright, so you got your hosts file and now want to put some servers in there. Sure you could try to figure out all the ad server names, but luckily other people are already collecting them into a database for your easy use. Here's the most up to date server I have found: http://pgl.yoyo.org/adservers/ At the top of the page you will see a drop-down list. Use the "in hosts file format" (or the mac version if your on a mac) and choose link or no link (all it does is add a comment at the top of the list about where you got it - could come in handy if you lose the URL). Click go and you will be presented with a list that is ready to be copied and pasted to your hosts file. Once you have this list, then restart your browser and you should be set to go. You might also have to flush your dns cache for it to work on everything. I know windows 2000 and XP cache server addresses. I believe the command to flush the dns is as follows:

command> ipconfig /flushdns

Every should work now. If not, then take a look at the pages I list below. Also, there are other formats of the list for certain routers, dns servers (if you run BIND, etc.) Take a look at the sites below if you want to learn more:

pgl.yoyo.org/adservers/
feh.net/adblock/adblock.shtml
www.accs-net.com/hosts/what_is_hosts.html
www.pestpatrol.com/Support/HowTo/How_To_Block_Ads.asp
www.macwrite.com/criticalmass/mac-os-x-hosts.php

Server Status

» Thu Apr 18 23:22:19 UTC 2024
» Uptime is 19 d 9 hr 26 min *
» Load is 2.1943359375 *

About Me

» Music Taste
» Resume
» Bulgaria
» Computers
» Ducati
» Audi

Hosting

» IntelliMold
» mgv Enterprises
» mgv Investments
» MPCon Forums
» Debian Forums
» Beglesh 2003

Friend's

» MPCon
» Jeff
» Jason

GNU/Linux

» Linux
» KDE Look
» KDE Apps
» Debian Packages
» Gentoo Forums

Support

» W3C
» EFF
» Firefox
» Jabber
» OpenOffice.org
» Creative Commons