I am new here but wanted to contribute what I feel is a big help with bad hosts, adware, spyware, malicious software, and bad servers.
I added the code below to my routers "Startup" and "DNSMasq" entries. It uses the hosts file from Welcome to the MVPs.org home page! to block these bad hosts (servers). It is basically doing the same thing as adding the hosts file to your system locally but this way, you only have to maintain the list on the router.
The way the code is written, it automatically refreshes the file from mvps.org each time you boot your router. I have my router on a scheduled boot each night to refresh the list for any updates added by mvps.org. I have been using this since last August and am very hapy with the results.
The code:
"Startup"
---------
_rogue=0.0.0.0
echo -e "#!/bin/sh\nn=1\nwhile sleep 60\ndo\n\twget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep \"^127.0.0.1\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\n" >/tmp/write_dlhosts
echo -e "\t[ \`grep -il doubleclick /tmp/dlhosts\` ] && break\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\ndone\n[ -e /jffs/hosts ] && cat /jffs/hosts >>/tmp/dlhosts\n[ -e /opt/etc/hosts ] && cat /opt/etc/hosts >>/tmp/dlhosts\nkillall -HUP dnsmasq" >>/tmp/write_dlhosts
chmod +x /tmp/write_dlhosts
/tmp/write_dlhosts &
"DNSMasq"
----------------
addn-hosts=/tmp/dlhosts
You will know you have it working because the blocked ads and banners will show up as "Internet Explorer cannot display the web page". I have a small program I run on my server to intercept the calls and send a blank pixel to the requesting system thus eliminating the "Internet Explorer cannot..." message. Instead of the error message, a nice clean blank block is shown making the page look nicer.
Note: There are a couple of applications designed to intercept these calls as well that are *freeware*. Pixelserv and AdServer are the ones I know of.
I am running a third-party firmware on my router (DD-WRT) and it is working great with this in place. If anyone has any questions, I will do the best I can to answer them. I got the code from the DD-WRT forums so I thank the good people who provided a way to do this at the router.
I hope this helps others!
Chris
I added the code below to my routers "Startup" and "DNSMasq" entries. It uses the hosts file from Welcome to the MVPs.org home page! to block these bad hosts (servers). It is basically doing the same thing as adding the hosts file to your system locally but this way, you only have to maintain the list on the router.
The way the code is written, it automatically refreshes the file from mvps.org each time you boot your router. I have my router on a scheduled boot each night to refresh the list for any updates added by mvps.org. I have been using this since last August and am very hapy with the results.
The code:
"Startup"
---------
_rogue=0.0.0.0
echo -e "#!/bin/sh\nn=1\nwhile sleep 60\ndo\n\twget -q -O - http://www.mvps.org/winhelp2002/hosts.txt | grep \"^127.0.0.1\" | grep -v localhost | awk '{print \"$_rogue\\\t\"\$2}' | tr -d '\\\015' >/tmp/dlhosts\n" >/tmp/write_dlhosts
echo -e "\t[ \`grep -il doubleclick /tmp/dlhosts\` ] && break\n\t[ \$n -gt 5 ] && break\n\tlet n+=1\ndone\n[ -e /jffs/hosts ] && cat /jffs/hosts >>/tmp/dlhosts\n[ -e /opt/etc/hosts ] && cat /opt/etc/hosts >>/tmp/dlhosts\nkillall -HUP dnsmasq" >>/tmp/write_dlhosts
chmod +x /tmp/write_dlhosts
/tmp/write_dlhosts &
"DNSMasq"
----------------
addn-hosts=/tmp/dlhosts
You will know you have it working because the blocked ads and banners will show up as "Internet Explorer cannot display the web page". I have a small program I run on my server to intercept the calls and send a blank pixel to the requesting system thus eliminating the "Internet Explorer cannot..." message. Instead of the error message, a nice clean blank block is shown making the page look nicer.
Note: There are a couple of applications designed to intercept these calls as well that are *freeware*. Pixelserv and AdServer are the ones I know of.
I am running a third-party firmware on my router (DD-WRT) and it is working great with this in place. If anyone has any questions, I will do the best I can to answer them. I got the code from the DD-WRT forums so I thank the good people who provided a way to do this at the router.
I hope this helps others!
Chris
Last edited:
My Computer
System One
-
- CPU
- a
- Motherboard
- a
- Memory
- a
- Graphics Card(s)
- a
- Sound Card
- a
- Monitor(s) Displays
- a
- Screen Resolution
- a
- Hard Drives
- a
- Case
- a
- Cooling
- a
- Keyboard
- a
- Mouse
- a
- Internet Speed
- a