PC Help Forum - Free Computer Help, Windows, Hardware, Software and more!
 
Become a Member Today!
Search PC Help Forum for Answers
 
Go Back   PC Help Forum - Free Computer Help, Windows, Hardware, Software and more! > The Important Stuff > Tutorials > Web, Internet and Network Tutorials
Web, Internet and Network Tutorials - Blocking ads on the Internet with a list of ad server hostnames and IP addresses posted in the Tutorials forums; Blocking ads on the Internet with a list of ad server hostnames and IP addresses start blocking ads now: four easy steps So, to start blocking ads: find your hosts ...

REGISTER NOW to remove these Ads

Comment
 
LinkBack Tutorial Tools Display Modes Language
Blocking ads on the Internet with a list of ad server hostnames and IP addresses
Published by joe5
01-24-2006
Default Blocking ads on the Internet with a list of ad server hostnames and IP addresses

Blocking ads on the Internet with a list of ad server hostnames and IP addresses





start blocking ads now: four easy steps


So, to start blocking ads:
  1. find your hosts file
  2. download the list of ad servers
  3. copy the list of ad servers on the end of your hosts file (see Where's my hosts file? if you don't know where it is)
  4. restart your browser
and that should hopefully be it. Don't forget though - there are loads of other ways to use this list! Using the list as a hosts file is not the most effective, but does help.




how it works


It's possible to set up a name server as authoritative for any domain you choose, allowing you to specify the DNS records for that domain. You can also configure most computers to be sort of mini-nameservers for themselves, so that they check their own DNS records before asking a nameserver. Either way, you get to say what hostname points to what IP address. If you haven't guessed already, the way you block ads it to provide bogus information about the domains we don't want to see - ie, all those servers out there that dedicate their existence to spewing out banner ads.

The hosts file

Probably the most common way people block ads like this is with something called the "hosts file". The hosts file is a simple list of hostnames and their corresponding IP addresses, which your computer looks at every time you try and contact a previously unknown hostname. If it finds an entry for the computer you're trying to reach, it sets the IP address for that computer to be whatever's in the hosts file.

127.0.0.1 is a special IP address which, to a computer, always means that computer. Any time a machine sends a network request to 127.0.0.1, it is talking to itself. This is very useful when it comes to blocking ads, because all we have to do is specify the IP address of any ad server to be 127.0.0.1. And to do that, all we have to do is edit the hosts file. What will happen then is something like this:
  1. you visit a web page
  2. the web page contains a banner ad stored on the server "ads.example.com"
  3. your computer says "ads.example.com? never heard of it. wait a second, let's see if I've got the number on me..."
  4. your computer finds its hosts file and checks to see if ads.example.com is listed
  5. it finds the hostname, which points to 127.0.0.1
  6. "great", says the computer, and sends off a request to 127.0.0.1 for the banner ad that's supposed to be on the page
  7. "oh", says the computer, and fails to show anything because it just sent a request to itself for a banner ad
Where's my hosts file?
The format of the hosts file is very simple - IP address, whitespace, then a list of hostnames (except for older Macs; please see above). However, you don't need to know anything about the format if you don't want to as you can just view the list hosts file.

Of course, that's not the only way to use the list, but it's probably the most simple for most people.




about this list

Why would anyone want a list of hostnames?

The ad banners that you see all over the web are stored on servers. Stopping your computer communicating with another computer can be quite simple. So, if you have a list of the servers used for ad banners, it's easy to stop ad banners even getting to your browser.

But ad banners don't bother me

If ad banners aren't a problem for you, then these pages aren't really going to do much for you. But personally, I hate them. I've never got used to having flashing images in the corner of my vision when I'm trying to read. Imagine if real books came with neon lights that blinked messages at you over and over again. And imagine that every time you turned the page, you had to wait a few seconds whilst they changed from neon green to neon yellow. And then they'd send the title of the book, your reading speed, and what chapters you've skipped to the central Library so that they can sell the information to all the big bookstores. Reading real books would be even more unpopular than it is now! But, I guess, maybe it wouldn't - millions of people do exactly the same thing on the Interweb every day (if you substitute the book for a web site).

Why do we do it to ourselves? We need to stop this. It's time to rise up! Let us be blinked at no longer! Let the flashing cease! Down with banners! Up with transfer rates! STOP THE MADNESS!

And, Brothers and Sisters, the first step starts with YOU. Blocking ads makes sense! Start today!

Isn't this a bit much for a list of hostnames?

I started doing this a while ago, and thought I'd put my list up on the Interweb for everyone to use. That was way back in the mists of 'Net time, when the Interweb was just the Web, and dotcoms were still getting funding. Eons later, a simple list of hostnames has evolved in to what you see before you. I guess it just goes to show - even the tiniest amoebic piece of slime can become the President of the USA if you leave it alone long enough.

Why not just use JunkBuster / Ad-aware / some other piece of software?

There's lots of great ad blocking software out there that's probably far more effective than just using this list. But there are also disadvantages to using these pieces of software, and sometimes people are unable to use them:

  • some methods produce false positives - eg, if you were blocking all hostnames beginning with "adservers", you wouldn't be able to get to this list by its usual URL (http://pgl.yoyo.org/adservers/ - which, incidentally, is why you can also get to this list via http://pgl.yoyo.org/as/)
  • some methods require admin privileges - using this list as a proxy autoconfig script means that users of most browsers can use it even if they're not administrators; installing programs and editing system files can often be restricted
  • some programs don't support all operating systems - eg, Ad-aware, a brilliant program, is only available for Win32 operating systems
But in any case, I'm not saying this list is definitely going to be useful to you. It's just here because it was easy for me to put it up, and there's been enough interest for me to keep updating things. If you're not interested, don't use it!


From , and more info here:
http://pgl.yoyo.org/adservers/
Tutorial Tools

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
 
By Bluefish on 01-27-2006
Default

Brilliant Joe, just brilliant!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #1  
By Pgh on 10-10-2006
Default

Where exactly do you paste the list to? I have found the "hosts" file, but i cannot open it. Do i just paste it in the etc folder?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
By Arctos on 10-10-2006
Default

Originally Posted by P-G-H
Where exactly do you paste the list to? I have found the "hosts" file, but i cannot open it. Do i just paste it in the etc folder?
Open the Host file with Notepad, then paste the list into it...

I use AdMuncher myself as it gives me a more flexible option in ad blocking...

Ad Muncher Usage Statistics for v4.7 Build 26932/1364 *BETA*
Adverts removed by Ad Muncher: 552,768
Approximate bandwidth saved: 4,318 MB
Counter started: March 8, 2006
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
By Bluefish on 10-10-2006
Default

Yes P-G-H, you have to right-click 'Open with', and select Notepad. But probably it'll ask you what software to use to open it automatically.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
By Axephilic on 08-22-2007
Default Re: Blocking ads on the Internet with a list of ad server hostnames and IP addresses

Vista will require special attention for the Hosts file. Here is an awesome tutorial by MVPS. The also offer a very good hosts file.

Vista Hosts File Tutorial

MVPS Hosts File

Thanks,
Adam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Comment


Go Back   PC Help Forum - Free Computer Help, Windows, Hardware, Software and more! > The Important Stuff > Tutorials > Web, Internet and Network Tutorials




Tutorial Tools
Display Modes

Posting Rules
You may not post new tutorials
You may not post comments
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT +1. The time now is 09:07 PM.