Ad-blocking with DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3 ... 17, 18, 19  Next
Author Message
silverplane
DD-WRT Novice


Joined: 18 Sep 2007
Posts: 2

PostPosted: Tue Sep 18, 2007 7:16    Post subject: Ad-blocking with DD-WRT Reply with quote
Hello all,

I recently purchased a Buffalo WHR-G125 and loaded it up with DD-WRT v24. I was wondering if there was any way to block a large list of websites that I have as ads? The filtering options currently in place only allows for a handful of sites to be blocked, and I have more than that. I also thought about messing around with the hosts file, but before I do that, I would like to ask the opinion of this forum as to what would be the best way to go about doing this.

Thanks in advance!
Sponsor
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Tue Sep 18, 2007 13:09    Post subject: Reply with quote
I do it all from the host file. It is easier. (at least for me.)

Check this out. http://www.mvps.org/winhelp2002/hosts.htm

I use it and it works great for keeping out the ads and banners.

redhawk

[EDIT]...almost forgot...I added this line to the host file.

127.0.0.1 pagead2.googlesyndication.com

It gets rid of the ads on dd-wrt forum too.

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Tue Sep 18, 2007 13:13    Post subject: Reply with quote
redhawk0 wrote:
I do it all from the host file. It is easier. (at least for me.)

Check this out. http://www.mvps.org/winhelp2002/hosts.htm

I use it and it works great for keeping out the ads and banners.

redhawk

[EDIT]...almost forgot...I added this line to the host file.

127.0.0.1 pagead2.googlesyndication.com

It gets rid of the ads on dd-wrt forum too.


do you just use this on your pc, or do you load it over the host file of the router?
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Tue Sep 18, 2007 13:19    Post subject: Reply with quote
Sorry I forgot to mention...PC only.

c:\windows\system32\drivers\etc (for WinXP)

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Tue Sep 18, 2007 13:23    Post subject: Reply with quote
I just looked at the latest host file (09/06/07)....it already has the pagead2.googlesyndicaton.com entered.

Good deal.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Tue Sep 18, 2007 13:51    Post subject: Reply with quote
this was ripped from a tomato forum and all credits go to mraneri at linksysinfo.org
logger WAN UP Script Executing
sleep 5
test -s /tmp/dlhosts
if [ $? == 1 ] ; then
echo -e "#!/bin/sh\nwget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
cru a Gethosts "45 23 * * 5 /tmp/dlhosts"


not sure if it will work with dd-wrt but might be worth taking a look.
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Tue Sep 18, 2007 14:01    Post subject: Reply with quote
Interesting...it calls to the same web site I posted. It obviously can be done through a cron job. I'll let someone with some programming experience test this one for us. I'd love to use this as a solution. I wouldn't have to do continuous maintenance on each PC this way.

redahwk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
speedy3k
DD-WRT User


Joined: 19 Apr 2007
Posts: 180

PostPosted: Tue Sep 18, 2007 14:12    Post subject: Reply with quote
the big question is, is there enough room on the the router for the host file.

here is the full thread. talking about this over there. I've been playing around with the idea of trying thisfor a few weeks now.

http://www.linksysinfo.org/forums/showthread.php?t=53133

EDIT:

i figured...what the heck and went ahead and tried it. works great under rc3 mini.
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Wed Sep 19, 2007 18:21    Post subject: Reply with quote
I'm using this simple script, and it seems to be working pretty well Smile
Code:
wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 127.0.0.1 | sed -e '2,$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/hosts
logger "$0: Hosts-file downloaded"

stopservice dnsmasq
startservice dnsmasq
logger "$0: DNSMasq restarted"

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Wed Sep 19, 2007 23:19    Post subject: Reply with quote
Yeah...this does work...but there ain't no way it will work on a neutered V5-6 Linksys.

I am running it on a 16M Linksys V2 and I only have 750K left now.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
anectine17
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1536
Location: Idaho

PostPosted: Thu Sep 20, 2007 5:58    Post subject: Reply with quote
FireFox's ad blocker works very well too. I didn't even know there were ads on the DD-WRT Forum!! Twisted Evil
_________________
Clear 4G Wimax.
Linksys WRT54G-TM w/14929 std-nokaid, fan-cooled, 2 GB SD mod, Primary Router.
Linksys WRT54G v.3 w/15230 std-nokaid, Client Bridge.
Linksys E2000 w/15200 "Big"
Linksys WRT54G v.4
La Fonera 2100, fan-cooled
Linksys WRT54G v.3.1
Linksys WRT54G v.1.1
Linksys WRT54GS v.1
2x Linksys WRT54G v.2.2

Peacock Thread - READ THOROUGHLY
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11447
Location: Wherever the wind blows- North America

PostPosted: Thu Sep 20, 2007 11:20    Post subject: Reply with quote
Ah....Good point...I have Ad-Blocker Plus running too. I'll turn that off tonight and give it another test with just the host.txt file on the router.

I forgot about this one....I'll turn off the internal Firefox "Block Pop-ups" too.

Thanx...

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
cyberde
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 1488
Location: the Netherlands

PostPosted: Thu Sep 20, 2007 13:21    Post subject: Reply with quote
anectine17 wrote:
FireFox's ad blocker works very well too. I didn't even know there were ads on the DD-WRT Forum!! Twisted Evil

Yes FF Adblocker rocks though, but I also want to block ads in IE and so on.
For FF i can suggest you install the "Adblock Filter.G Updater" too, this ads another list to Adblocker to block even more ads :D

I've also added a host file of my own, where I can manually add domains which aren't listed in this hostfile. Mostly dutch ad providers Evil or Very Mad

_________________
Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N

Donater
fencepost
DD-WRT Novice


Joined: 19 Sep 2007
Posts: 14

PostPosted: Thu Sep 20, 2007 13:49    Post subject: I actually allow ads Reply with quote
For sites that I care about supporting, I'll actually leave ads enabled - after all, that's one thing that lets them make a bit of money.
cheebs
DD-WRT Novice


Joined: 19 Apr 2007
Posts: 14
Location: Kent UK

PostPosted: Thu Sep 20, 2007 15:35    Post subject: Reply with quote
What a great idea this is.

Can someone please tell me in noob terms how to run the script? I am new to DDWRT, and a complete linux virgin. I have looked at the wiki, but i dont really understand some of the terms used.

I tried putting the scripts posted earlier in this thread in the command shell and executed it, but nothing seems to have changed.

Using WHR-HP-G54 with v23 sp3

Thanks in advance
Goto page 1, 2, 3 ... 17, 18, 19  Next Display posts from previous:    Page 1 of 19
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum