Member Panel


Sponsors and Ads

Noticeboard

PC Forum PC Help Forum » Tutorials » Web, Internet and Network Tutorials » Blocking ads on the Internet with a list of ad server hostnames and IP addresses

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 ...

JOIN US NOW to remove these Ads

Post New Thread  Reply
  #1  
Old 01-24-2006
joe5's Avatar
Elite Member
My PC
 
Join Date: Jun 2005
Location: Netherlands
Posts: 9,046
joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page joe5 - See this Members User comments on their Profile page
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/


__________________
- PCHF Team. - (NL) - Mal-ware Eradicator! -

  #2  
Old 01-27-2006
Bluefish's Avatar
Elite Member
My PC
 
Join Date: Jan 2005
Location: Holland
Posts: 2,187
Bluefish - See this Members User comments on their Profile page Bluefish - See this Members User comments on their Profile page
Default

Brilliant Joe, just brilliant!!!


__________________
PCHF Rules - You're Welcome!
What's inside my PC? - Prework
  #3  
Old 10-10-2006
Pgh Male Pgh is offline
Moderator
My PC
 
Join Date: Jul 2006
Location: Herts, UK
Posts: 711
PC Experience: Some Experience
Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page Pgh - See this Members User comments on their Profile page
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?


  #4  
Old 10-10-2006
Arctos's Avatar
Elite Member
My PC
 
Join Date: Sep 2006
Location: Bundaberg, Australia
Posts: 607
PC Experience: Very Experienced
Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page Arctos - See this Members User comments on their Profile page
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


__________________

Some Guy: Artificial intelligence is no match for natural stupidity...
  #5  
Old 10-10-2006
Bluefish's Avatar
Elite Member
My PC
 
Join Date: Jan 2005
Location: Holland
Posts: 2,187
Bluefish - See this Members User comments on their Profile page Bluefish - See this Members User comments on their Profile page
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.


__________________
PCHF Rules - You're Welcome!
What's inside my PC? - Prework
  #6  
Old 08-22-2007
Axephilic's Avatar
Computer Programmer
My PC
 
Join Date: May 2007
Location: Wisconsin, US
Posts: 1,115
PC Experience: Experienced
Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page Axephilic - See this Members User comments on their Profile page
Send a message via AIM to Axephilic Send a message via MSN to Axephilic
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



Reply
Satellite TV on your PC - over 3000 Channels! Click Here!

Bookmarks

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB 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 07:35 AM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
All Graphics & Content Copyright © 2004-2008 - PC Help Forum.com


Back to Top