How to Get Rid of Pretty Much Every Ad on the Internet

I’ve always hated ads on the internet. I don’t want to find out how to be a nurse or an insurance adjuster, I know I’m not actually the 10,000th lucky visitor to the site, my auto insurance is fine, I very much doubt girls in my area want to meet me, I already know my IQ, and my PC does not need to be scanned, because I’m not on a PC.

So, I went looking for ways to block ads, and I found a pretty good one.

On the Mac, there’s a secret system file called “hosts.” Every time you go to a website, the system checks the “hosts” file to see if there’s a special place it should look for that website. Almost all the time, it won’t find an entry for the web site in the “hosts” file, and it will go out and look on the internet for the website instead.

Also, every time you go to a web page, you might actually be seeing content built from several different websites. For example, if you go to msnbc.com, some of the content might actually be coming from msn.com. But to you, the user, it will all look seamless.

Okay, so how can we use that knowledge? It turns out that almost every ad you see on the internet is being served from specialized ad sites, not from the site you’re actually looking at. For example, if you’re looking at msnbc.com, it might be loading in an ad from doubleclick.net. So… what if we went into the special “hosts” file and told it a wrong address for doubleclick.net? The browser would never be able to load the ad!

But you don’t have to go through and figure out the addresses of all the ad sites out there. A group of people on the internet have already compiled an extensive list of ┬ájust about every ad site there is. They’ve even added in sites that will try to “phish” information from you! I’ve added in a few entries of my own based on my experience. The result is a custom “hosts” file that you can install on your computer that will banish almost every ad out there!

Here’s how to do it…

(Please note that these instructions assume you’re using Safari. Even if you’re normally a Firefox user, please use Safari to download the file.)

Click on this link to download the magic “hosts” file to your Mac. If you’re not sure where the file was downloaded to, click on the little magnifying glass next to the file in the “Downloads” window that should have popped up.

In the Finder (if you’re not in the Finder, click the little smiley face at the bottom-left of your screen,) click on the Go menu and choose “Go to Folder…”

A little alert will pop up. In the text field, type “/etc”. That’s a slash, then e t c, and then hit return. A new window should appear, showing you the secret contents of the /etc folder:

Next, click on the File menu and choose “New Finder Window.”

This will open a window to your default user folder, the place where most people keep their stuff.

Position the user folder window and the /etc window so you can see both.

In the /etc window, find the file named “hosts.” Drag it to your user folder window.

Now, you have an emergency copy of your original “hosts” file, should anything go wrong.

Next, find the “hosts” file you downloaded from here and drag it into the /etc window.

You’ll probably see an alert like this:

Click Authenticate (since this is an important system file we’re changing, the computer wants to confirm we’re the owner.)

Type in your computer’s password (some people need this password to log in, some need it when adding new programs… that’s the password we need here.)

You may also see an alert asking if you want to replace an existing file. Tell it yes, you want to.

Now, reboot your Mac to make sure the changes have taken effect, then explore a few web sites. You’ll find them free of ads! And if you’re on a slow connection, you might find web sites loading a little faster. After all, your computer no longer has to download all those ads when it downloads the web site!

I hope this creates a happier, less annoying internet experience for you.

Leave a Reply