Author Topic: Ad blocking with ad server hostnames and IP addresses  (Read 3321 times)

Offline Protools5LEGuy

  • Global Moderator
  • Platinum Member (500+ Posts)
  • *****
  • Posts: 2328
Ad blocking with ad server hostnames and IP addresses
« on: October 10, 2016, 05:54:58 AM »
Just found a method to block ads in MacOS 9.

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 / Adblock / 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 URLs containing the word "adservers", you wouldn't be able to get to this list by its usual URL ( - which, incidentally, is why you can also get to this list via
    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!

Feel free to combine this list with yours or lists from other sites and put it up on the web, though!

Also: I only add top level ad server domains. So, please don't submit hostnames like "", as "" is already listed, and please don't submit "" if "" 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 or just fill out the comments form below.

Ad server submission disabled until further notice.


start blocking ads now: four easy steps
So, to start blocking ads:

    find your hosts file
    download the list of ad servers
    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)
    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. is a special IP address which, to a computer, always means that computer. Any time a machine sends a network request to, 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 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 ""
    your computer says " 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 is listed
    it finds the hostname, which points to
    "great", says the computer, and sends off a request to 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

  Where's my hosts file?

    Windows 95 / 98 / ME: C:\Windows (I think)
    Windows NT: C:\WinNT\hosts
    Windows 2000: C:\WinNT\system32\drivers\etc
    Windows XP: C:\Windows\System32\drivers\etc
    Windows Vista: C:\Windows\System32\drivers\etc
    Windows 7: C:\Windows\System32\drivers\etc
    FreeBSD / Linux / Mac OS X / Unixish operating systems: /etc/hosts
    Classic Mac OS: please read this helpful information submitted by David "iNerd" B
    Mac OS 9: Marcia Skidmore sent in details that hopefully explain what you need to know
    Mac OS 10+: Tina Kent sent in details for later versions of Mac OS

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.

David "iNerd" B sent in the following helpful information:

    On Classic Mac OS, the hosts file is called "Hosts" and resides either in the System Folder or in the Preferences folder therin (depending, I beleive, on OS version). Of course, if you've never used one on your computer, then it might not exist. In any case, it is a plain text file (as usual), so anyone can create or edit it with no special software. After editing it, either restart (don't -- it's quicker the other way) or open the TCP/IP control panel, click the Hosts button, select it in the Open File dialog, click OK (when it asks), close the control panel, and click save (when it asks). On Mac OS X, of course, it is in the same location as it would be in Unix (BSD "Darwin").

Thank you muchly David! Hopefully someone out there will find that useful.

Marcia Skidmore sent in this useful information about the using the list in host file format on Macs:

    Under Mac OS 9 and earlier there is a hosts file in the root level of the system folder. If you're using Open Transport it can also be located inside System Folder:Preferences, although either will work. Or you can just open the TCP/IP control panel and go into Advanced under User Mode in the Edit menu. Then you have the option of choosing whatever hosts file you like and it will be put where it needs to be. I've also been looking at the syntax for host files under this system, and you should use for this either SITE_NAME. A (the period is required) or SITE_NAME CNAME On Mac OS X the hosts file is in /etc/hosts and can easily be modified through the terminal using pico. I used the command to open it "sudo pico /etc/hosts" and everything worked fine. It works the same as on any UNIX system except that for your computer to use it you must use a utility called Directory Access, which is in Macintosh HD:Applications:Utilities:Directory Access. Just press the check-mark next to the option "BSD Configuration Files" and restart your computer.

I hope any Mac users out there find the above helpful. The list of ad servers in Mac hosts format has now been updated to have a period at the end of the server name and use A records instead of CNAMEs. Thanks Marcia!
Looking for MacOS 9.2.4

Offline Protools5LEGuy

  • Global Moderator
  • Platinum Member (500+ Posts)
  • *****
  • Posts: 2328
Re: Ad blocking with ad server hostnames and IP addresses
« Reply #1 on: October 10, 2016, 06:14:05 AM »
This method came after MR swamprock replied on

Quote has a frequently updated HOSTs file. Their script even generates one for the classic MacOS...
Looking for MacOS 9.2.4

Offline Mat

  • Gold Member (200+ Posts)
  • *****
  • Posts: 437
Re: Ad blocking with ad server hostnames and IP addresses
« Reply #2 on: October 10, 2016, 07:15:10 AM »
Yeah! I described exactly this here already a few years ago. Sadly my posting got deleted by you can imagine whom, ...
It works really great and speeds up the webbrowsing a lot. Best is, if you have the huges data colletion sites as well included in your hosts file. Put google (use duckduckgo instead for searching), facebook and a few others there, and classilla will feel like flying! ;)

Offline geforceg4

  • Platinum Member (500+ Posts)
  • *****
  • Posts: 535
  • i did my time on mac os 9
Re: Ad blocking with ad server hostnames and IP addresses
« Reply #3 on: October 10, 2016, 10:14:47 AM »
noone deleted your posts mat.
i still dont understand what happened that day and why only some of your posts were affected.
that was really wierd.