[HowTo] Block ads on all browsers

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

[HowTo] Block ads on all browsers

#1 Post by Iguleder »

This is the easiest and most efficient method to block all ads for all browsers. Your browser won't even download the ads, so you save time, nerves and bandwidth.

The trick is simple, it redirects the addresses of ad services to your own computer's address.

1) Go to http://pgl.yoyo.org/as
2) Select “host --in hosts file format
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#2 Post by chrome307 »

Thanks for sharing this tip :)

don922
Posts: 433
Joined: Sat 19 Jan 2008, 07:58
Location: Nong Yai Buah

How did you make the 1st post in this thread?

#3 Post by don922 »

I have made the addition to /ect/hosts that you described above. It seems to be working -- Thank You.

How did you make the first post in this thread, ie., where the graphics are part of the original post; not part of an attachment.

This makes a much nicer and more understandable presentation.
[color=green][i]Don -- Thailand[/i][/color]
[url=http://www.puppylinux.com][img]http://tinypic.com/4e0tojl.jpg[/img][/url]

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#4 Post by CatDude »

Hello don922
don922 wrote:How did you make the first post in this thread, ie., where the graphics are part of the original post; not part of an attachment.

This makes a much nicer and more understandable presentation.
If you are logged in (on the forum), click on the Quote button in Iguleder's post,
and you will see how it is done.

Basically all you do is,
upload your images somewhere (tinypic.com in Iguleder's case),
then, using the links provided when you uploaded your images, insert them in the appropriate place in your post.

CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#5 Post by sc0ttman »

Could I take the lists of addresses in PeerBlock and add them (in the correct format of course) to the host file?

That would be lovely, don't know why it never occured to me before..
But maybe someone else does, so thought I'd just ask..
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
chrismt
Posts: 255
Joined: Wed 21 Apr 2010, 04:37

#6 Post by chrismt »

@ Iguleder

These hosts are updated frequently and there are a lot of hosts which not only block ads but also malware :D

Like

Cameleon

* Site: http://sysctl.org/cameleon/
* Source: http://sysctl.org/cameleon/hosts


hpHosts

* Site: http://www.hosts-file.net/
* Source: http://support.it-mate.co.uk/downloads/hphosts.zip
* Mirror: http://hphosts.gt500.org/hosts.zip


hpHosts (Ad and tracking servers only)

* Source: http://www.hosts-file.net/ad_servers.asp
* Mirror: http://updates.it-mate.co.uk/hphosts/ad_servers.asp


hpHosts (Partial)

* Source: http://www.hosts-file.net/hphosts-partial.asp
* Updated: Frequently
* Mirror: http://updates.it-mate.co.uk/updates.asp


MVPS Hosts

* Site: http://www.mvps.org/winhelp2002/hosts.htm
* Source: http://www.mvps.org/winhelp2002/hosts.zip


I wish someone create a small tool which does this automatically and checks for updates every time I launch that app

It would be time consuming to update these hosts by hand

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#7 Post by Shel »

Absolutely the best way to do this sort of blocking is to run your own DNS server and have the updates applied automatically to the appropriate zone files by a script run by a cron job. As far as machines on your LAN are concerned, you become the "authoritative" DNS server for all those advertisingh/malware domains, and you can redirect all attempts to contact them to 127.0.0.1 or 0.0.0.0 or even your own webserver.

This has the additional advantage of making the updated information available automatically and transparently to any machine on your network.

-Shel

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#8 Post by Ibidem »

I advise you to make sure that the file saves as text:

Code: Select all

wget \
http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&startdate[day]=&startdate[month]=&startdate[year]=&mimetype=plaintext
file serverlist.ph*
#if text, just copy to /etc/hosts:
I break so noone copies too much:

Code: Select all

#IF NOT HTML:
cat serverlist.ph*|grep ^127\\.0\\.0\\.1>>/etc/hosts
Basically, I just checked the "plain text" box and copied the URL.
Grep sorts out all lines beginning (^) with 127.0.0.1 (\\. is a literal period, as . or \. matches any character); this is appended to /etc/hosts.
NOTE that this hasn't been tried!

Same method might work with others.

don922
Posts: 433
Joined: Sat 19 Jan 2008, 07:58
Location: Nong Yai Buah

Doesn't seem to work in Wary 5.0

#9 Post by don922 »

I have used this method of blocking ads in Puppy 4.0, Puppy 4.12, Puppy 214X and have not had a problem. Seems to work great.

However, I have tried to use it in Wary 5.0 and it doesn't seem to work.

I have used it with firefox browsers either FirePup (firefox 1.5.0.12) or FireFox 3.5.9.

What can I do to make the host file blocking work in Wary?
[color=green][i]Don -- Thailand[/i][/color]
[url=http://www.puppylinux.com][img]http://tinypic.com/4e0tojl.jpg[/img][/url]

shadower_sc
Posts: 136
Joined: Wed 21 Apr 2010, 23:03
Location: Texas

Flashblock

#10 Post by shadower_sc »

I use the Firefox Add-On Flashblock. It blocks all Flash content from playing and gives you a nice little Flash icon to click on, if you need to play the item. This way I skip all the Flash Ads. :-) You can also add a site to the Flashblock Whitelist, if you do not want it to block Flash on that site. I think you have to restart Firefox for the changes to the Whitelist to take effect.

User avatar
Bernie_by_the_Sea
Posts: 328
Joined: Wed 09 Feb 2011, 18:14

#11 Post by Bernie_by_the_Sea »

Mostly I use SeaMonkey with the Firefox/SeaMonkey addon called Prefbar. With a mouse click you can individually disable flash, animation, JavaScript and/or images. It also has a easy UserAgent changer for those sites that insist on IE. I also use AdBlock Plus that works quite well.

I use a DNS service that “censors

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#12 Post by nooby »

Crazy question. (Edit: Ooops forgot to thank Iguleder for excellent presentation)

Would not the ad firms know if we do such things?

Them getting ravingly mad at us and getting back on us using persistent cookies somethign and sneaking in the backdoor. I mean these people do pay for total access to our buying habits :)

Sure I tease a bit but I am dead serious too. If they are so nasty that they produce persistent cookies on some 8 to 11 places hard to find on the HDD then they would collect instances of such tricks we do here and them come up with even more nasty circumvention to win the war we escalate on them.
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

nooby wrote:Crazy question. (Edit: Ooops forgot to thank Iguleder for excellent presentation)

Would not the ad firms know if we do such things?

Them getting ravingly mad at us and getting back on us using persistent cookies somethign and sneaking in the backdoor. I mean these people do pay for total access to our buying habits :)

Sure I tease a bit but I am dead serious too. If they are so nasty that they produce persistent cookies on some 8 to 11 places hard to find on the HDD then they would collect instances of such tricks we do here and them come up with even more nasty circumvention to win the war we escalate on them.
they want consumers that are interested in their commercial product, so some may actually be thankful depending on how the ad revenues are set up besides we are less than 1% of the market share ... sometimes its nice to be invisible. also it would cost them $ to change strategies, while all we would need to do is add another line to a text file (for free)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Bernie_by_the_Sea
Posts: 328
Joined: Wed 09 Feb 2011, 18:14

#14 Post by Bernie_by_the_Sea »

technosaurus wrote: they want consumers that are interested in their commercial product, so some may actually be thankful depending on how the ad revenues are set up besides we are less than 1% of the market share ... sometimes its nice to be invisible. also it would cost them $ to change strategies, while all we would need to do is add another line to a text file (for free)
It's not just Linux -- I blocked ads and most cookies for years in Windows. Adblock is available for Firefox (PC) and Safari (Mac) plus Opera has its own ad blocking extension. I imagine the majority of web surfers block ads. Advertisers know that 99% of viewers don’t look at their ads but to make money they only need one out of a hundred thousand to take the bait and click.

User avatar
Luluc
Posts: 200
Joined: Wed 16 Mar 2011, 07:10

#15 Post by Luluc »

I always handled that problem with Privoxy. Is there a Puppy package for Privoxy? But anyway, the hosts file tweak is a good option too.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Block ads

#16 Post by L18L »

Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Internet

Advert-Blocker

Shep
Posts: 878
Joined: Sat 08 Nov 2008, 07:55
Location: Australia

Re: [HowTo] Block ads on all browsers

#17 Post by Shep »

[quote="Iguleder"]This is the easiest and most efficient method to block all ads for all browsers. Your browser won't even download the ads, so you save time, nerves and bandwidth.

The trick is simple, it redirects the addresses of ad services to your own computer's address.

1) Go to http://pgl.yoyo.org/as
2) Select “host --in hosts file format

User avatar
bups
Posts: 27
Joined: Tue 05 Jun 2012, 18:54

#18 Post by bups »

Thank you all for the lists.

Post Reply