Posted: Tue Sep 18, 2007 7:16 Post subject: Ad-blocking with DD-WRT
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.
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.
Joined: 04 Jan 2007 Posts: 11564 Location: Wherever the wind blows- North America
Posted: Tue Sep 18, 2007 14:01 Post subject:
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 _________________ The only stupid question....is the unasked one.
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Thu Sep 20, 2007 13:21 Post subject:
anectine17 wrote:
FireFox's ad blocker works very well too. I didn't even know there were ads on the DD-WRT Forum!!
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 _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N
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.