ad-blocking with DD-WRT revisited (simple)

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6 ... 12, 13, 14  Next
Author Message
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Wed Mar 25, 2009 17:34    Post subject: Reply with quote
Yes...

If you place some hosts in the same format in a file called /jffs/hosts or /opt/hosts they will be added to the /tmp/dlhosts

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Sponsor
GDixon
DD-WRT Novice


Joined: 24 Mar 2009
Posts: 10

PostPosted: Wed Mar 25, 2009 18:51    Post subject: reply Reply with quote
root@AP-V2:~# cat /tmp/write_dlhosts
#!/bin/sh
n=1
while sleep 60
do
wget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep "^127.0.0.1" | grep -v localhost | awk '{prin t "0.0.0.0\t"$2}' | tr -d '\015' >/tmp/dlhosts

[ `grep -il doubleclick /tmp/dlhosts` ] && break
[ $n -gt 5 ] && break
let n+=1
done
killall -HUP dnsmasq
root@AP-V2:~#
GDixon
DD-WRT Novice


Joined: 24 Mar 2009
Posts: 10

PostPosted: Wed Mar 25, 2009 18:51    Post subject: end of reply Reply with quote
hmmm I see i'm getting a /tmp/dlhosts and not a /opt/dlhosts...Could this be the trouble? and why is it not making the /opt/dlhosts if it is? I'm not using jffs (which is why i used this script over the other one you made) or changing anything else. I have the addn-hosts=/tmp/dlhosts added at the additional dnsmasq options and dnsmasq , local dns checked. this is a wrt54 g ver 2.2 running SVN revision 11650M NEWD Eko...also have it giving static ip's out to both wired and wireless using mac's and wep, only one dhcp address enabled to give out to a guest, everything else is static. runs rock solid with a automatic reboot once a week, only thing in the router i ever see is tx errors ( not too many, 10 to 50 in a week ) plug and play is enabled and works, ddns is enabled and works. Mostly just a standard config on the router.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Wed Mar 25, 2009 23:45    Post subject: Reply with quote
Forget the /opt in my example.
I'm putting everything on my USB-stick....

Your script seems fine except for the space between "prin t" but that probably came from pasting it here in the forum.

It clearly says to replace 127.0.0.1 to 0.0.0.0

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
GDixon
DD-WRT Novice


Joined: 24 Mar 2009
Posts: 10

PostPosted: Wed Mar 25, 2009 23:54    Post subject: Reply with quote
hmmm yes the space came from the cut and paste....I'll make some changes on the router config and see what happens.
evilvoice
DD-WRT Novice


Joined: 01 May 2008
Posts: 14

PostPosted: Sun Mar 29, 2009 5:22    Post subject: Reply with quote
how do you remove a line from the hosts file? I ask because every once in a while I need to visit bill.ccbill.com and everytime I do, it blocks it...so im thinking if there was a command I could issue which would comment the line, and then a command that would uncomment the line for when I dont need it and I could save it as a custom script. Thanks in advance.
GDixon
DD-WRT Novice


Joined: 24 Mar 2009
Posts: 10

PostPosted: Wed Apr 01, 2009 20:34    Post subject: Reply with quote
Frater,
I did a 30 30 30 reset and redid everything.
Must have been something sticking in nvram. All works and now comes back as 0.0.0.0
lombana
DD-WRT Novice


Joined: 04 Oct 2007
Posts: 5

PostPosted: Sun Apr 19, 2009 16:26    Post subject: Reply with quote
Thank you for fixing this Frater, I just noticed today that my script was not working, updated with your new example from the start of this post and all is well again! Thank you so much!!!

Miguel
Xymox
DD-WRT User


Joined: 02 Mar 2009
Posts: 144
Location: Phoenix, Az

PostPosted: Mon Apr 20, 2009 0:59    Post subject: Reply with quote
Are there other maintained hosts lists that provide other bad guy lists ? Say virus/exploits

And can someone provide a script to take any hosts list on the net and add it to the list already in place ?

Frater, what is the source of the entries on the http://www.mvps.org/winhelp2002/hosts.txt list ?

How often is it maintained ?
Xymox
DD-WRT User


Joined: 02 Mar 2009
Posts: 144
Location: Phoenix, Az

PostPosted: Mon Apr 20, 2009 3:48    Post subject: Reply with quote
Let me answer my own questions

http://www.mvps.org/winhelp2002/criteria.htm

Nice project !...

Thanks for bringing it to dd-wrt in a simple to implement form..

It works perfectly on my wrt54G-TM using Mega build 11793
uncle bob
DD-WRT User


Joined: 31 Aug 2008
Posts: 148

PostPosted: Thu Apr 23, 2009 19:57    Post subject: Reply with quote
yeah so what it is nice because looks like suckers got smart and idea of blocking them with hosts does not work well for example i cannot watch videos on video.msn.com, some other sites also do not play. also had case where appletv was rebooting because of some 2o7.net site
i think next step should be not hosts file but something like adblock on ff instead of blocking http get requests should be checked.
RCShadows
DD-WRT User


Joined: 17 Aug 2008
Posts: 437

PostPosted: Sun Apr 26, 2009 1:39    Post subject: Reply with quote
frater,

This is working great on my WRT160Nv1! I am also using the AdServ program on my server and again...GREAT! Thanks to all for the help in getting this set up. I am humbled.

I am spreading the word as well. Safety is so important when surfing the net!
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Apr 26, 2009 6:43    Post subject: Reply with quote
uncle bob wrote:
yeah so what it is nice because looks like suckers got smart and idea of blocking them with hosts does not work well for example i cannot watch videos on video.msn.com, some other sites also do not play. also had case where appletv was rebooting because of some 2o7.net site
i think next step should be not hosts file but something like adblock on ff instead of blocking http get requests should be checked.


Although it's not my idea, it's still a good idea because the whole thing is quite transparent and it does a good part of the job without having any performance setbacks.

You're focusing on the things it can't do. Well, it doesn't do my dishes either, but that doesn't make it a valid complaint.

PS.. I waited a whole day to make sure that my previous statement was true and I can confirm... For sure it doesn't do my dishes. Crying or Very sad

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
uncle bob
DD-WRT User


Joined: 31 Aug 2008
Posts: 148

PostPosted: Mon Apr 27, 2009 14:52    Post subject: Reply with quote
i did not say it is your idea nor that is bad.
this is not about dishes Frater nor many other other things.
We should evolve Frater evolve that is word
RCShadows
DD-WRT User


Joined: 17 Aug 2008
Posts: 437

PostPosted: Wed Apr 29, 2009 12:55    Post subject: Reply with quote
frater,

I have been using AdServer to clean up my pages in conjunction to your code. I wanted to ask if Homer could be used instead? Homer listens on 127.0.0.1 by default. Do you know of a way to make it listen so all workstations on the intranet can ustilize it?

Here is the link to Homer...

http://www.funkytoad.com/index.php?option=com_content&view=article&id=14&Itemid=32&28d444df85eb4f435055ed9d39c02f03=516cafc4560872a74a8192ea143e5a6c

Thoughts?
Goto page Previous  1, 2, 3, 4, 5, 6 ... 12, 13, 14  Next Display posts from previous:    Page 5 of 14
Post new topic   Reply to topic    DD-WRT 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