How to filter annoying ads
If you are (like me) tired of some sites pushing you annoying content that some times is even noisy, there is a solution.
I am going to show you a quick and easy way to prevent that from happening again. The trick is done in a similar way web filters like Websense or SurfControl operate but this time we are making the change directly in our machine.
For our example, I am removing the annoying video that pops up when browsing www.elmundo.es. This video only plays in the US but it is annoying enough that I wanted to remove it forever from showing up.
Here are the steps I followed:
1. LOCATE THE SOURCE FOR THE CONTENT
There are different ways to view what’s going on inside a web page, I used HTTPFOX, a plugin for FIREFOX that tells you what it is loading in the page. The idea is to know exactly where the undesired content is coming from.
On this case we found multimedia content coming from vindicoast.edgesuite.net as a video with extension flv. I don’t normally browse that site, and the ads that I have seen from it are not very interesting so I will go ahead and completely block vindicoast.edgesuite.net and to make sure there are no other subdomains, I will also block edgesuite.net.
2. Edit the HOSTS file on your computer
The HOSTS file is a delicate file so be careful how you make the edition. My recommendation is to make a copy of the original file before making any changes. This file is similar to a local DNS and takes precedence over the Internet DNS. So any changes you make in here will affect your whole system and all your installed browsers.
On a Windows computer:
- Open a command prompt or browse with your Windows Explorer to C:/WINDOWS/SYSTEM32/DRIVERS/ETC
- Open the file HOSTS with your notepad
- Add an entry to redirect the undesired URL to 127.0.0.1
- Execute sudo vi /etc/hosts in order to edit the file
- If you don’t know VI this could be a little tricky. Basically you need to move with the arrow keys to the last line you have and click I to insert into the file. Then make it look like this one.
- When you are done click ESC in order to exit INSERT mode
- Now you type :wq! in order to exit saving the file
- And just with this your annoying ad is gone.