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!

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.

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 URLs containing the word "adservers", you wouldn't be able to get to this list by its usual URL (https://pgl.yoyo.org/adservers/ - which, incidentally, is why you can also get to this list via https://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 or applications - eg, Adblock, a very useful tool, is only available for the Firefox browser.

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!

submit a hostname for the list

If you know of any other lists like this, or any ad servers I don't have listed, please mail me or type the hostname in here. (you don't need to give me your email address, but it would be nice to be able to say thanks. I promise not to use it for anything bad).

Please note: although I sincerely appreciate being sent huge lists of hostnames, I don't have the time to check them for duplicates, invalid hostnames, hosts that aren't actually ad servers, etc. Submissions from the form below go into a database that allows me to easily check them and add them to the list. Please use it!

Also: I only add top level ad server domains. So, please don't submit hostnames like "ad.se.doubleclick.net", as "doubleclick.net" is already listed, and please don't submit "host1.ads.example.com" if "ads.example.com" is already listed. Unfortunately, including all subdomains would be too time consuming for me. If you find an ad server that you want added but won't be according to these criteria, the best thing to do would be to keep a personal list which you just add this one to.

Unfortunately it's probably not worth submitting anything at the
moment - spam has taken over. 10,000 mails a month to sift through, even
with automated checking, is just too much extra. Fuckin spammers.

Please send general stuff to pgl@yoyo.org or just fill out the comments form below.

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:

you visit a web page

the web page contains a banner ad stored on the server "ads.example.com"

your computer says "ads.example.com? never heard of it. wait a second, let's see if I've got the number on me..."

your computer finds its hosts file and checks to see if ads.example.com is listed

it finds the hostname, which points to 127.0.0.1

"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

"oh", says the computer, and fails to show anything because it just sent a request to itself for a banner ad

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.

A much more efficient way of using the list is with a nameserver. See below for details.

If you're behind a proxy, and your browser allows you to specify pages that don't use the proxy, then putting the entries in the list of internal sites will effectively block traffic from those sites. If your browser supports automatic configuration of its proxy settings via an external URL, you can simple set your autoconfig script to be either of these URLs to stop seeing ads:

Pinder Johal detailed in his blogzilla how to use the list to block ads with Mozilla. to do this, download the list as a cookie permission file, and put it in "C:\Documents and Settings\User\Application Data\Mozilla\Profiles\user\*.slt" (this is the directory for Windows 2000/XP users, so it will probably differ on other platforms). have a look at his site for more info.

With Microsoft's DNS server

Wolfram Kraushaar has kindly provided instructions on how to use the list with Microsoft's internal DNS cache. You will need a null zone file (similar to the one provided for use with Bind 8) which he also provided: adservers.dns. This file should go in %SystemRoot%\system32\dns (so, C:\WinNT\system32\dns for most people). Then, follow these steps:

double click the file and confirm the updates to your system registry to add the servers

restart the DNS service

Wolfram also suggests: "setting up a Virtual Host on an Apache with an ErrorDocument 404 which says 'this host has been zapped'", as some browsers complain if they can't connect to hosts needed by web pages. I use Opera, which has this problem, and this is exactly what I do to get around it. If you think Apache is a bit overkill or too much effort, have a look at SimpleServer from AnalogX - as the name implies, it's easy to set up and use.

Another way to stop your browser complaining is to point the IP addresses to a live web server instead of 127.0.0.1 (although it would probably be a bit slower as the browser would try to connect to it for each ad). You can specify an alternative IP address to be used on the list ad servers when the HTML intro is included.

Thanks Wolfram!

These are just a few of the ways to use the list. I've tried to make the list viewable in various formats that are convenient for various other methods, and I'll add more as I come across them. If you'd like me to add some particular way of listing the hostnames of IP addresses, let me know and I'll add it.

Other Nameservers

Using the list of ad servers with a name server is one of the most efficient methods. It allows you to block entire domains, rather than just individual host by configuring your nameserver to act as master for the zone. For example, by setting your DNS server to be master for "doubleclick.net", all requests for hostnames under "doubleclick.net" will fail, instead of having to add entries for "ad1.doubleclick.net", "ad2.doubleclick.net", etc.

Another advantage is that if you use a nameserver on a LAN, setting up a machine to block ads is as easy as changing its nameserver. There's only one machine that needs to be kept up to date, and no extra software or configuration is needed on any other machine.

I've made a list of freeware software that you can use with this list. Again, if you know something that should be on the list but isn't, please let me know (but please, only if the product doesn't have to be paid for).

If you're thinking about switching to using a nameserver instead of a hosts file, you might find these scripts useful:

Squid is a proxy server commonly used in big networks to lower bandwidth usage and speed up download times. It sits between the users and the Internet so it can control network usage intelligently (unlike most browsers / OSes / anything). You can configure it to deny access to particular hostnames or IP addresses, so it's easy to set it up to block ads. I don't use it myself, but Stephen Patterson kindly sent in a script he uses with Squid to block ads. Unfortunately due to me forgetting to add the "plain text (no HTML)" option for viewing the hostnames, it's not necessary anymore, but he did give some good information on how to configure Squid. Apparently all you need to do is define an ads acl in Squid's config file that points to the file with the list of hostnames, then just set that acl to deny:

acl ads dstdomain "/etc/squid.adservers"
http_access deny ads

After that all you need is to keep the list of hostnames up to date. To give you an idea of how you might do that, check out Stephen's script (slightly modified by me). Cheers Stephen!

Note: This information was originally incorrect (it said "acl ads src" instead of "acl dstdomain src". Many thanks to Patrick Steiner emailing me to point this out.

Update: Another way of configuring Squid might be effective at blocking ads. Instead of using the "dst" acl type (which only blocks access to a specific hostname), the "dstdom_regex" type allows you to block access to domains and all subdomains under them. The first line from the Squid configuration above would then change to:

acl ads dstdom_regex -i "/etc/squid.adservers"

Because of the way regular expressions work, you also have to specify the list of ad servers in a particular format to avoid potentially blocking legitimate servers as well as ad servers. To view the list in this format, just select the Squid dstdom_regex option from the select box above.

My colleague Vladimir Pissarev (who is part of the Security team in our company) mentioned to me that he runs a public DNS server that not only blocks ads and trackers, but also malware and viruses as well. Set your DNS to