How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to block block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by catweazel »

all41 wrote:hey catweasel how can you tell if it works?
doubleclick.net

Working...

Code: Select all

This site can’t be reached

doubleclick.net refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
Not working...

Code: Select all

Realize what’s possible with digital

Connect with the right people, in the right moments, with DoubleClick's integrated solutions.
Put insights in your inbox
Get product news, case studies, industry reports and more, direct from DoubleClick and Google.
please don't plonk me
*PLONK*
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
blockhead47
Level 3
Level 3
Posts: 140
Joined: Wed Jun 15, 2016 4:50 pm

Re: How to block block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by blockhead47 »

I also monitor MVPHosts and update my /etc/hosts file when a new version is posted.
As many of you I also have that process automated with a script.
I would not depend solely on browser based blockers. Other things, especially email might try
to reach out and touch a bad site. If /etc/nsswitch.conf is configured right, which it is by default,
my /etc/hosts file is there to give some measure of protection.
User avatar
all41
Level 19
Level 19
Posts: 9521
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by all41 »

ublock was already in control of double click.
*PLONK*
exactly--a predicted response.
Everything in life was difficult before it became easy.
User avatar
majpooper
Level 8
Level 8
Posts: 2087
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by majpooper »

Come on guy - it is just a suggestion - if you don't want to use it fine don't use it. Some of us happen to think it is and added layer of protection - we get it - you don't think it gets you anything of value. hoooah drive on.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by catweazel »

all41 wrote:*PLONK*
exactly--a predicted response.
On the contrary. I tell porkies. Big ones. Often.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
BG405
Level 9
Level 9
Posts: 2508
Joined: Fri Mar 11, 2016 3:09 pm
Location: England

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by BG405 »

I think using the hosts file is a great idea and TBH I'd forgotten about it. Used to use it years ago in WinXP/7. It being browser-independant (and effective for all programs which can access the Web) is a good thing. Means not having to configure all the rules for each browser add-on. :)

syg00 wrote:I park a pi3 as a getway/router so the entire house can be protected
Home network filtering is something I intend to set up at some point but this won't offer any protection when out & about.
Dell Inspiron 1525 - LM17.3 CE 64-------------------Lenovo T440 - Manjaro KDE with Mint VMs
Toshiba NB250 - Manjaro KDE------------------------Acer Aspire One D255E - LM21.3 Xfce
Acer Aspire E11 ES1-111M - LM18.2 KDE 64 ----Two ROMS don't make a WRITE
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by Flemur »

BG405 wrote: Means not having to configure all the rules for each browser add-on.
Same with privoxy - just route the browser thru the proxy...or not, if you don't want to. I use the same setup for firefox and vivaldi/chrome.

I block so much advertising that it often breaks videos, so to see a "broken" video I just start a browser which doesn't use the proxy, which is trivially easy. If you're using the hosts file you'd have to switch between different copies of it, and (I think) restart your internet so it rereads the hosts file.

AND! If videos from news sites generally play OK, then you're NOT blocking enough advertising and tracking.

The "lightbeam" firefox addon is great for showing all the bogus sites some websites talk to - there are sometimes well over a hundred trackers and advertisers.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by trytip »

the reason one might want the use of a hosts file is that this is system wide so even if a malicious script wants to use curl to download something hidden in the background it will be blocked. if you use noscript or ublock extensions you are only protected while using the browser

i use mpvhosts along with http://someonewhocares.org/hosts/

one trick though is that if you have ipv6 you will need to double the entry where 0.0.0.0 is ipv4 and ::1 is ipv6 so an example of blocking doubleclick.com is"

Code: Select all

0.0.0.0 doubleclick.com
::1 doubleclick.com
i convert all entries from 127.0.0.1 > 0.0.0.0

it was and still is frustrating to understand this at first but the more you learn the more you know and yes it does get rather frustrating trying to keep upfated but you can use a hosts 1 year old and still work pretty damm good since domain names don't change often
Image
blockhead47
Level 3
Level 3
Posts: 140
Joined: Wed Jun 15, 2016 4:50 pm

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by blockhead47 »

Thanks for the tip @trytip.
I forgot about the IPv6 addresses.
Updated my script to add those for each mvp host entry.
BaconPancakes

Re: How to block ads, banners, 3rd party cookies, page counters, web bugs and hijackers

Post by BaconPancakes »

I use a fairly massive hosts file set up on Win* and Android devices, in addition to everything I can block in whatever browsers I'm using. It works on Linux as well, obviously, but I had some issue on my latest install with a 27mb hosts choking out internet traffic entirely. (Behaviour reminded me of the DNS server service bugs on Win.)

The more you can block, the better.

Though given the nature of *Nix in general I'm kind of surprised there's no service or program to auto pool mvps hosts files along with the others such as with Hostman.
Post Reply

Return to “Tutorials”