removing ad’s from your home network with dd-wrt

A bit tired of too many ad’s poping up on various sites especially those links from facebook etc.. so I’ve combined multiple sources to block ad’s using my dd-wrt router.

Place the following into Administration->Commands and save as startup

rm /tmp/hosts
mkdir /tmp/abc
wget -qO /tmp/abc/addhosts http://szojox.ugu.pl/hosts
wget -qO /tmp/abc/jansal http://jansal.googlecode.com/svn/trunk/adblock/hosts
wget -qO /tmp/abc/malwaredomain http://www.malwaredomainlist.com/hostslist/hosts.txt
wget -qO /tmp/abc/winhelp2002 http://winhelp2002.mvps.org/hosts.txt
wget -qO /tmp/abc/adaway https://adaway.org/hosts.txt
wget -qO /tmp/abc/ad_servers http://hosts-file.net/.%5Cad_servers.txt
wget -qO /tmp/abc/gjtech http://adblock.gjtech.net/?format=unix-hosts
wget -qO /tmp/abc/someone http://someonewhocares.org/hosts/hosts
cat /tmp/abc/addhosts /tmp/abc/jansal /tmp/abc/malwaredomain/tmp/abc/winhelp2002 /tmp/abc/adaway /tmp/abc/ad_servers /tmp/abc/gjtech /tmp/abc/someone | sed -e 's/^[ t]*//' | grep -v ^# | sort | uniq > /tmp/hosts
rm -rf /tmp/abc
rm /etc/hosts
ln /tmp/hosts /etc/hosts
stopservice dnsmasq && startservice dnsmasq

make sure to enable dnsmasq & Local DNS under the Services tab and add addn-hosts=/tmp/hosts onto Additional DNSMasq Options and Apply


  1. Is there anyway to have this update every night to keep the lists updated?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.