Nowadays the Internet has become an extremely popular medium, very dynamic, always on the move ... although several years ago an evil that overwhelmed the network was the excess of animated images (gif) that made reading difficult, and also made it ugly Anywhere, at present we have gotten rid of a good part of the 'fashion' of gifs and in addition to flash files, BUT !, in our network today there is another enemy: Advertising
How many of you access sites in one day from the Internet that have NO advertising?
Let's do a count of popular sites:
- Google (has advertising in search results)
- Facebook (more advertising could not have)
- Twitter (… similar to Facebook, too much advertising)
- Sports sites like ESPN, Marca, etc ... the same, too much publicity
- And a GREAT etc etc
Nowadays, finding sites that do not have annoying, intrusive advertising (yes, AdSense I'm talking about you!) Is really difficult, the bigger / popular the site is, the more advertising it has, it is almost a constant (with exceptions of course).
The browsers are multiple, we have from Firefox, Chromium / Chrome, Opera, Rekonq, and etc ... if we want to block advertising for all our browsers then we would need to install a plugin that does this in each of them, after the plugin continues to have support for the latest version of the browser, etc.
That is why although Adblock is a very good alternative, I prefer to stick with my method.
Table of Contents
The / etc / hosts file serves as a small internal DNS, that is, normally when we access a site in our browser (www.facebook.com, for example) the browser asks the world's DNS at what IP address, On what server is that site we want to access, but if we specify the IP in / etc / hosts then there will be no question that the browser should ask.
That is (and getting into the matter):
We must indicate through our / etc / hosts that the advertising domains are on our own PC (127.0.0.1), by doing this the browser will search for the advertising on a web server that we have on our computer BUT, as we do not have any web server, then it just won't show anything.
For example, to block Google advertising I run the following in a terminal:
sudo echo "127.0.0.1 ad-ace.doubleclick.net" >> / etc / hosts sudo echo "127.0.0.1 ad.es.doubleclick.net" >> / etc / hosts sudo echo "127.0.0.1 googleads.g. doubleclick.net ">> / etc / hosts sudo echo" 127.0.0.1 pagead2.googlesyndication.com ">> / etc / hosts sudo echo" 127.0.0.1 pubads.g.doubleclick.net ">> / etc / hosts
Once this is done, we close the browser and access a site that has Adsense-type advertising, we will no longer see it 🙂
My list of domains in / etc / hosts is somewhat extensive, since there are many sites that offer advertising (as well as unnecessary .js), I frequent sports sites (As, Marca, Central Defense, etc.) in addition to the normal, other types of sites (Twitter specifically I open little, I use Choqok), I leave my list here:
### ADVERTISING ### 127.0.0.1 activate.tapatalk.com 127.0.0.1 active.cache.el-mundo.net 127.0.0.1 ad-ace.doubleclick.net 127.0.0.1 ad.amgdgt.com 127.0.0.1 ad. es.doubleclick.net 127.0.0.1 ads.ad4game.com 127.0.0.1 ads.mcanime.net 127.0.0.1 ads.redluckia.com 127.0.0.1 aimfar.solution.weborama.fr 127.0.0.1 anapixel.marca.com 127.0.0.1 apis.google.com 127.0.0.1 b.scorecardresearch.com 127.0.0.1 bs.serving-sys.com 127.0.0.1 cache.elmundo.es 127.0.0.1 cartel.cubadebate.cu 127.0.0.1 cdn.amgdgt.com 127.0.0.1 connect.facebook.net 127.0.0.1 cstatic.weborama.fr 127.0.0.1 engine.adzerk.net 127.0.0.1 en.ign.com 127.0.0.1 staticos.cookies.unidadeditorial.es 127.0.0.1 staticos.latiendademarca.com 127.0.0.1 googleads.g.doubleclick.net 127.0.0.1 images.eplayer.performgroup.com 127.0.0.1 impes.tradedoubler.com 127.0.0.1 js.revsci.net 127.0.0.1 k.uecdn.es 127.0.0.1 media.fastclick.net 127.0.0.1 .127.0.0.1 openx.fichajes.net 2 pagead127.0.0.1.googlesyndication.com 127.0.0.1 platform.twitter.com 127.0.0.1 pubads.gd oubleclick.net 127.0.0.1 scdn.cxense.com 127.0.0.1 scorecardresearch.com 127.0.0.1 serve.williamhill.es 127.0.0.1 static.batanga.net 127.0.0.1 static.eplayer.performgroup.com 127.0.0.1 vht.tradedoubler. com 127.0.0.1 view.binlayer.com 127.0.0.1 www.calendariodeportes.es 127.0.0.1 www.google-analytics.com 127.0.0.1 www.googletagservices.com 127.0.0.1 www.marcamotor.com 127.0.0.1 www.weborama. com 101 www.wtpXNUMX.com
This solves almost all of my problems, since I have checked the html of the sites that I frequent to detect the .js or advertising that I do not want my browser to load, hence I took these domains or subdomains to block.
Advantages and disadvantages of this method compared to others like Adblock?
The main disadvantage of this method that I show you with Adblock, is that Adblock is constantly being updated, that is, the plugin already knows which domains it should block, while doing it in this way that I showed you are the ones that should add the domains or subdomains to your / etc / hosts
The main advantage that I see in this method is simple, it works for everyone, absolutely all the browsers that I have or will have on my computer. In addition, I usually use the Alpha versions of Firefox, with this method I avoid that plugins (like Adblock) tell me that they are not compatible with my version of the browser, etc. Oh by the way, I'd rather be the one who blocks the sites, call me crazy but I don't like the idea of a plugin blocking content from my browser, I'd rather be the one who controls this 🙂
Anyway, I know that many might call me selfish because I block advertising (and advertising benefits the authors of those sites), but it happens that my internet connection is really, very very slow, I cannot use bandwidth to load images or advertising that certainly doesn't interest me, which I won't click either.
Here ends the post, I hope it has been useful.