Block ads with DD-WRT
I have been using a windows host file to block ads on websites for a while now. The host file (http://www.mvps.org/winhelp2002/hosts.txt) redirects most ad links to 127.0.0.1 instead of their IP address. By doing this, it shows either a blank page or “page can not be displayed” instead of the normal advertisements.
I wanted to take this one step further and apply this to my router (Linksys E2000) using DD-WRT. After searching the dd-wrt forums (http://www.dd-wrt.com/phpBB2/viewtopic.php?t=20346), I came across the script to do this. Some routers like WRT54G v5 and v6 will not be able to do this as there is not enough memeory to store the host file.
To apply the script you will need to do 3 steps.
- Under the Services Tab, enable DNSMasq.
- Under the Services Tab, enable Local DNS.
- Under the Administration Tab, click the Commands tab. Paste the code below in the box and click ‘Save Firewall’.
- Save Firewall – Saves this as a firewall script. Every time your WAN port connects up, it will redownload the host file.
- Save Startup – Saves this script as a startup script. Each time your router boots, it will download the hosts file.
- Run Commands – Run the script once.
- Save Custom Script – Saves the script but does not run it, it stores it so you may run it manually.
What this script does it downloads the host file from the above link, searches for the IP address of 127.0.0.1, replaces 127.0.0.1 with 0.0.0.0 and then saves it to /etc/hosts on the router. This will replace /etc/hosts file so you will not be able to use http://DD-WRT to get to the router anymore. Just use http://192.168.1.1 or whatever the router IP address is.
Here is the script:
wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep -v "#" | 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"
Update: MVPS.org changed the format of the hosts.txt file from 127.0.0.1 to 0.0.0.0. Script has been modified to remove the comments (#).
June 29th, 2013 at 1:39 pm
I have tried this script.Its working fine but on one of my machine which has winxp it takes ages to load websites with this script running.Any suggestions will be apperciated. I am running dd wrt on belkin.
thanks
December 9th, 2014 at 11:17 am
The script does not appear to work; after entering and saving the script and so on, and rebooting the router, it appears that the hosts file consists of just two lines–where I’d expect to see the contents of the file referenced on http://www.mvps.org... Perhaps I misunderstand the recipe.
In the description of this script’s how-to (on the site blog.arwin.me/software/dd-wrt/block-ads-with-dd-wrt/), it might be useful to provide:
– information relative to the line-breaks in the script provided;
– a possible correction to the lack of white-space/line break before “stopservice …”;
– information relative to any dependencies of the script and its associated ‘how-to’ steps on other services available in the DD-WRT configuration (e.g. logging, telnet, etc.); and,
– information about how to verify that the script has run without errors (e.g. using the Commands function, or some other method).
February 9th, 2025 at 3:58 pm
Free celebrity porn videos real celeb sex tapes pornhub
http://big.tits-benedict.hoterika.com/?aimee-eva
gater porn gay porn ed pensyl big titty free porn videos free porn tube gagging free amatuer swedish porn movies
February 11th, 2025 at 7:17 pm
Top 5 anal cams sites find your favorite anal cam girl here
http://horseshow2016.fistmature.kanakox.com/?kianna-deanna
girl tenn porn full length desi porn awesome free porn videos legal porn model ages arkham asylum poison ivy porn
February 14th, 2025 at 3:36 am
27 websites to watch free movies online without downloading
http://catalinagiraldo20-cosplayand.tubered69.com/?nikki-joelle
non nude soft porn free young thi porn stormy porn free porn star taylor summers free homemdae porn tube sites
February 16th, 2025 at 7:08 am
10 of the sexiest gay romantic films you can watch right now
http://13thbirthdaygames-hotteenpics.allproblog.com/?deanna-eileen
free email porn pic britney spears porn tube ddds furry art porn free porn gallery tour porn star womdn
February 18th, 2025 at 10:14 am
What should i teach my high school aged teen about sex and
http://asianropebunny-marysport.tiktokpornstar.com/?amya-maia
free ultra hd porn porn video kitten natividad porn catorgies interacial porn gallerys grow penis like the porn stars
February 20th, 2025 at 1:08 pm
Three quarters of teenagers have seen online pornography by
http://my18teens.android-sexy-silk.que-owned.lexixxx.com/?mattie-jaidyn
free full porn movies kinky best boob in porn industry presently hottest hd porn videos free teen porn only girls boobs anna tomase porn
February 22nd, 2025 at 4:04 pm
List of categories on yuvutu homemade amateur porn movies
http://verycutepics-lesbi.titsamateur.com/?erin-daphne
vintage porn rain girl free porn erotica fir women gay oral porn thumbnails hot ass lesben porn mother wants sex porn tube
February 24th, 2025 at 7:12 pm
Large hd tube free porn latina long 51 110 hd videos
http://free.fat.xxx.porn.video.tiktok-pornhub.com/?marissa-alexandra
does watching transexual porn you porn soapy massage porn archives listed by star top 100 porn images adam homemade porn
February 26th, 2025 at 10:11 pm
How to find hire models for your porn shoots adent blog
http://massivegaydick-interestingcomedymovies.bestsexyblog.com/?tracy-juliette
porn athletic girl masturbation z tv porn video ted bundy on porn women with women porn free divx hd porn
March 1st, 2025 at 8:34 am
All vintage porn movies and retro xxx classic videos allclassic porn
http://counter.tiquilla.energysexy.com/?kaila-maryam
teen lesbian blonde porn hot ebony teacher porn batgirl and supergirl porn ree porn video iphone free ebony golden tube porn
March 3rd, 2025 at 10:13 pm
What are the best porn search engines porn dude blog
http://pittsburgh.bring.adablog69.com/?joy-kara
free porn xxn menatplay porn for iphone orininal porn porn in victorian dresses smemale porn tube
March 6th, 2025 at 11:47 pm
Redtube free hardcore porn videos all sex movie categories
http://kendra-beachy-head.tiktokpornstar.com/?breana-kalyn
downloadable free honeymoon porn avl award for porn stars mckenzee miles throated porn torrent escorts to make porn valerie bertinelli porn
March 10th, 2025 at 9:43 am
Erofus free sexics and adult cartoons pornics hentai 3d
http://homemadenewsex-smallfunnyvideoclips.adablog69.com/?bria-alexis
searching japanese porn the wrong woman 1990 porn free porn vvideos clips movies really young teen free mobile porn free porn movies real player
March 13th, 2025 at 11:19 pm
You actually make it seem so easy with your presentation but I find this matter to be really
something which I think I would never understand. It seems
too complex and extremely broad for me. I’m looking forward for your next post,
I will try to get the hang of it!
March 14th, 2025 at 3:50 am
Pornhub categories find your favorite free hardcore porn videos
http://androidsexysongwithmusicimages-arabia.celebrityamateur.com/?yuliana-ashleigh
carmen cocks porn ts tv porn master wacker porn best porn starts of the 80 top female porn models
March 17th, 2025 at 10:54 am
Die porno videos in der kategorie deutsche amateurin
http://android.sexy.songs.go-home-kama.tiktok-pornhub.com/?kendra-nikki
peru amateur porn is watching porn considerd as fornication scally yng teen nude porn boys vcoyer tube porn celebrity porn pussy
March 20th, 2025 at 6:23 am
Joel birkin that bel ami model with one of the biggest dicks in porn
http://kartoon.ipswich.xblognetwork.com/?janice-avery
german gannies porn tubes list of romanian porn stars porn tube cries black nick toons porn list hj goddess porn
March 21st, 2025 at 10:20 pm
奶牛
March 22nd, 2025 at 11:47 am
Thumbzilla hottest adult porn videos get your free porns
http://dormida-android.sexy-prime-car-mode.amandahot.com/?raquel-madeleine
free ebony porn full length videos hott free porn trailers tiffany million porn free mandingo interacial porn free ameture gay porn videos
March 24th, 2025 at 9:43 pm
British porn videos collection of best porn hd porn tube
https://fake-boops-usa-quotes-alcohol.celebrityamateur.com/?destiney-ally
epsilon porn tube porn chubby catoon network porn porn young shaved hardcore ebony mature porn
March 27th, 2025 at 2:52 am
27 000 forint helyett ingyen adnak egy szuperfun kal zos s
https://karna-montage-2-photos.amandahot.com/?odalys-tina
horse girls porn videos sharing homemade porn comic porn teen tiatins futeroma porn u s porn
March 29th, 2025 at 9:57 am
The controversial photography works of irina ionesco
https://kissmyboobs.alypics.com/?joanna-maliyah
ebony girl white guy porn porn tube wife bucket to downlaod free indian porn scandal porn harmony ashley robbins porn star
March 31st, 2025 at 7:55 pm
Mompov porn channel free mom pov videos matures porn
https://tenporn-babyboyfirstbirthdayinvitationcardsfree.moesexy.com/?jenna-kelsi
xxx porn party angry video game nerd porn uk student porn video mature porn free mobile porn sites with videos
April 1st, 2025 at 3:50 pm
Thanks in support of sharing such a pleasant thought, piece of writing is nice, thats why i have read it completely