Those ads.. whatever shall I do?

Call sandman, you shall! I have the perfect solution for anyone who either is a sucker for all those ads that tell you you have a virus, or for anyone who dies from the load time for commercial sites with ads crammed in every little not-already-covered nook and cranny. The solution:

OK, what you have to do is first decide what servers you want to block. Here’s a short list I got a while back from casually browsing for about 20 minutes and looking at where the links go to:

  • ad.doubleclick.net
  • pagead2.googlesyndication.com
  • ar.atwola.com
  • a.tribalfusion.com
  • servedby.advertising.com

OK, now that we have a list of ugly adservers we want to actually tell Windows to block it. All we gotta do is peel away XP’s friendly surface and get to those inners. Open up C:\WINDOWS\system32\drivers\etc\HOSTS in a text editing program. Notepad is fine.

Now if you’ve never edited this file before, it should look something like this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost

Now all I did was add on the list of servers up at the top of the post here, to create this:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost ad.doubleclick.net
127.0.0.1 pagead2.googlesyndication.com ar.atwola.com
127.0.0.1 a.tribalfusion.com servedby.advertising.com

I only did 2 per line because for some reason having more than 4 on one line was making it not work.

So we just set up Windows to work essentially as a secondary DNS. After editing the file, try going to ad.doubleclick.net. It’ll redirect you to 127.0.0.1! There’s not a required restart for this. Windows applies the changes right away. Now it’s very convenient that you can still go to http://www.doubleclick.net without a problem, but you never see any ads, because they’re all hosted on ad.doubleclick.net.

So as long as the page doesn’t reserve an element with a specific size, you’ll see a few empty areas surrounded by lines and the word ‘ADVERTISEMENT’ pretty constantly. Here’s the Download Squad homepage (before and after) as a great example to what this does:

Before:

After:

You can see that on the right, a bit above the middle of the picture, there’s an empty rectangle. Look at the previous picture to see what used to be there.

Also look at the top, where the banner was. This is an example of where they make elements with specific sizes. So unfortunately you may see a lot of blank spots, but it’s better than distracting ads!

Hope this helps everyone.

Edit: A cool idea for people with a web server: make the redirect go to a different port, say, 127.0.0.1:8000, and make the index page on that port say: “BLOCKED!”

1 Response to “Those ads.. whatever shall I do?”



  1. 1 ecologica.bg Trackback on October 18, 2014 at 5:52 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: