There are several ad sites that you’ll see being used everywhere. They slow down page loading, even on fast connections, because sometimes there’ll be lag and they won’t load immediately and instead of being able to read that interesting news article, you’re stuck waiting for some Flash animation to show up so you can ignore it. A simple way to make those ads 1) not show up and 2) not cause delays in page loading is to edit /etc/hosts. Check out for ways of doing this in Windows and Mac.

Here’s an example /etc/hosts file:       localhost

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

We’re not interested in anything after the first line, really, because that first line is the key to our trick. What it’s doing is associating a host name (e.g. localhost) with an IP address (e.g. What we’re going to do is assign some common ad host names to IP addresses beginning with 127.0.0, and ending with some number. The idea here is to point the host name, in our case some ad site, to an IP address that goes right back to localhost. This will cause the ad to load immediately because it’ll be looking on your local system, but since you’re not going to have /adi/N3271.RealCities/B1808805.8;sz=300x250;click=… on your computer, the ad will just show up with a ‘Not Found’ message.

So as root, edit /etc/hosts with your favorite editor and add the following lines:

Now any site that tries to load an ad hosted on one of those sites will instead display a message akin to the one in the screenshot above. If you find any other sites that host ads that you don’t want to see, just add another line to /etc/hosts.

Thanks to my dad for showing me this trick.