1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Auto DL Hosts File and Install...

Discussion in 'Tomato Firmware' started by mraneri, May 27, 2007.

  1. mraneri

    mraneri LI Guru Member

    No and No. Works fine no matter what the cache limit is.
     
  2. Dashiell

    Dashiell Network Guru Member

    Thank you! It does work quite well!
     
  3. Dgege

    Dgege Network Guru Member

    Just wanted to thank you for this script, works well with my WRT54GS :) No more crappy ads AND faster browsing, amazin!
     
  4. callous

    callous Network Guru Member

    Is there a way to add custom entries and then automerge it with what it gets from the web?
     
  5. smilespray

    smilespray Addicted to LI Member

    I found the problem. Major broadcasters use this site for podcast tracking, which is in the blacklist:

    127.0.0.1 int.sitestat.com #[SiteAdvisor.azter.com]

    I solved the problem by modifying your script like this:

    Code:
    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\necho -e '212.72.38.147 int.sitestat.com' >> /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"
    
    Result:
    $host int.sitestat.com
    int.sitestat.com has address 212.72.38.147
    int.sitestat.com has address 0.0.0.0

    Which works! Well, it only works until they change their IP address.

    I think I did well for a newbie. Would like some input on how to make it better, if anybody can figure out how to simply delete the line for int.sitestat.com in the master hosts file.
     
  6. mraneri

    mraneri LI Guru Member

    Seems like you are a self starter. Nice job. One thing I'd been thinking of doing, but haven't is created a whitelist by passing the list back through grep and using an inverse filter... So, filter out any lines that match a string. If you look at the grep options, you can probably figure out how to do it with one line. I would like to work on making it work with a list of sites, but have been swamped with work, and haven't been able to sit down for a little while a bang it out.

    - Mike
     
  7. smilespray

    smilespray Addicted to LI Member

    And so I have done. There are two whitelisted sites in the example.

    Code:
    logger WAN UP Script Executing
    sleep 5
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
    
        #Whitelist entries copied from /etc/hosts, not from the public site.
        whitelist1="0.0.0.0  int.sitestat.com"
        whitelist2="0.0.0.0  www.adtrader.com"
        echo "$whitelist1" > /tmp/whitelist
        echo "$whitelist2" >> /tmp/whitelist
    
        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:]]*#.*$//' > /tmp/hosts\ngrep -Fvf /tmp/whitelist /tmp/hosts > /etc/hosts\nlogger DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
        chmod 777 /tmp/dlhosts
        /tmp/dlhosts
        rm /tmp/hosts
        rm /tmp/whitelist
    fi
    cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
    
    As always, code criticism is welcome!

    PS: I HATE sed! It took me five hours of fiddling before I found a proper grep alternative.
     
  8. callous

    callous Network Guru Member

    ok.

    How do i disable and remove the host file after it is active?!
     
  9. mraneri

    mraneri LI Guru Member

    Looks good. You shouldn't need the whole line in the whitelist, though...

    whitelist1="int.sitestat.com"
    whitelist2="www.adtrader.com"

    should do it just as well.
     
  10. mraneri

    mraneri LI Guru Member

    login to the router via telnet, delete /etc/hosts, and execute a "killall -1 dnsmasq" to reparse the hosts file
     
  11. callous

    callous Network Guru Member

    Thank you!
     
  12. mraneri

    mraneri LI Guru Member

    Since it's on a cron, don't forget it will re-download it, and reinstall it based on the schedule... If you REALLY want to kill it, erase the script and reboot!!!! (But you probably figured that!)
     
  13. smilespray

    smilespray Addicted to LI Member

    Not sure. The grep command works on the whole line, I believe. Or do you know otherwise?
     
  14. mraneri

    mraneri LI Guru Member

    grep returns whole lines that have a match anywhere in the line. in fact, my script uses grep to filter out any line which does not contain 127.0.0.1. You don't have to match the whole line, but it will return the whole line if there is a match.

    I assume grep with the inverse switches works the same.
     
  15. smilespray

    smilespray Addicted to LI Member

    Will have a look tomorrow! :)
     
  16. smilespray

    smilespray Addicted to LI Member

    Simpler, shorter and more maintainable. Rev 8.

    Code:
    logger WAN UP Script Executing
    sleep 5
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
    
    	touch /tmp/whitelist
    	#Whitelist hosts - uncomment and change/add as needed:
    	#echo "www.adtrader.com" >> /tmp/whitelist
    	#echo "int.sitestat.com" >> /tmp/whitelist
    
    	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:]]*#.*$//' > /tmp/hosts\ngrep -Fvf /tmp/whitelist /tmp/hosts > /etc/hosts\nrm /tmp/hosts /tmp/whitelist\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"
    
    
     
  17. smilespray

    smilespray Addicted to LI Member

    Strange wget option

    I meant to ask: What does the lone dash in the wget command do?

     
  18. mraneri

    mraneri LI Guru Member

    After the -O would normally be the output filename. Then the URL. If you put a filename there, it would save the contents of the url to the file. When you replace the file with "-", it routes the contents of the url to stdout (no file), which is then directly piped into grep/sed before being piped to a file. This just saves some file IO.

    Pipes are awesome... If you don't know what pipes are, google "lunix pipes" and you should get tons of hits.
     
  19. smilespray

    smilespray Addicted to LI Member

    If you don't know what pipes are, google "lunix pipes" and you should get tons of hits.[/QUOTE]

    Oh, I am piping and > and >>'ing all the time. Learnt it way back on the Amiga, if I remember well. It's just that I am an on Mac user and getting to the power level in different shells is taking some time - for instance BusyBox uses ash, so several of my successfull experiments on the Mac did not go to well on the Linksys box. But boy did I feel accomplished when it worked.

    One side effect of using your script is that CPU usage when viewing a web page goes down by quite an amount - no more sucky Flash ads that tend to use all available resources!

    BTW: I bought my Linksys box as a T-Mobile special model from a seller called "pjenkins" on eBay. It has 32 MB RAM and has all the headroom you could possibly need. Highly recommended!
     
  20. mraneri

    mraneri LI Guru Member

    EDITED 9/19/2011: Updated MVPS Hosts File URL location.
    EDITED 2/28/2014: Updated to handle 0.0.0.0 in hosts files.
    EDITED 4/19/2014 - Updated path where hosts file is stored so it is automatically picked up by dnsmasq with no need for a configuration option.

    So, I finally buckled down and formalized, as efficiently as I can, the changes required to implement a whitelist. The below script does exactly what the original script does, and creates a whitelist via a "here document", pipes the list back through grep, filtering out anything in the list.

    Stick your whitelist items in as you see fit (note, the example whitelist includes the 11 sites used by techbargains.com for links). This has been tested and should work with all versions since 1.07 (or earlier). Any questions, ask.

    Don't forget to change the cron time as I suggested in the first post so we don't all hit the server at the same time.

    (thanks smilespray for the push to do this.)

    Code:
    logger WAN UP Script Executing
    sleep 5
    
    cat > /tmp/whitelist <<EOF
    bfast.com
    cc-dt.com
    click.linksynergy.com
    clickserve.cc-dt.com
    linksynergy.com
    myaffiliateprogram.com
    qksrv.net
    service.bfast.com
    www.anrdoezrs.net
    www.commission-junction.com
    www.qksrv.net
    EOF
    
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
        echo -e "#!/bin/sh\nURL=http://winhelp2002.mvps.org/hosts.txt\nwget -O - \$URL | grep .0.0. | grep -Fvf /tmp/whitelist | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/dnsmasq/hosts/blkhosts\nlogger DOWNLOADED \$URL\nkillall -1 dnsmasq" > /tmp/dlhosts
        chmod 777 /tmp/dlhosts
        /tmp/dlhosts
    fi
    cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
     
    Last edited: Apr 19, 2014
  21. smilespray

    smilespray Addicted to LI Member

    Very elegant - and glad to have helped in a little way.
     
  22. smilespray

    smilespray Addicted to LI Member

    So I am, in my infinite wisdom, trying to add a custom BLACKLIST to your script.

    Code:
    logger WAN UP Script Executing
    sleep 5
    
    cat > /tmp/whitelist <<EOF
    int.sitestat.com
    EOF
    
    sed 's/^\(.*\)$/0.0.0.0  \1/g' > /tmp/blacklist <<EOF
    annonser.dagbladet.no
    db-admatch.osl.basefarm.net
    EOF
    
    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 | grep -Fvf /tmp/whitelist | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' | cat - /tmp/blacklist > /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"
    
    EDIT: It works. I had a question about my use of " | cat - /tmp/blacklist > /etc/hosts". Somehow I could not get it to run before - I got an empty hosts file and no ad blocking.

    Again, sorry to be a pest.
     
  23. Thank you very much for the script, mraneri.

    I have a question. Can I use the routers Webserver to host a single dot gif file for all 404 request? Therefore I would replace 127.0.0.1 with the IP of my router. But the problem is, I always need a password to access any file on the router via http. I am searching for a solution to redirect all 404 request to the router to a gif file an the router without the need to authenticate. The administration GUI should still be protected. Does anyone having an idea how to solve this?
     
  24. mraneri

    mraneri LI Guru Member

    It's been discussed in a couple of threads (maybe even this one). Try a search. The short answer is without some significant hacking, you can't do it right on the router. You need some other tool on the router running (even then, I'm not sure it would work. I don't remember definitively.) You could always setup another PC to act as a gif image server, but that was never too appealing to me.

    Good luck.
     
  25. stud.beefpile

    stud.beefpile Addicted to LI Member

    Add multiple sources

    I was wondering if you could shed any light as to how to add an additional list to check, like from <http://www.it-mate.co.uk/downloads/hosts.txt>, and, say, just append it to the list created by the initial script.

    I have no expertise, but just tried substituting the address (http://www.it-mate.co.uk/downloads/hosts.txt) in the "if" statement of the original script from MVPS, and that didn't work.

    One other question. . .I've had your script running on my router for some time, and it seems that every so often, either the router forgets it or doesn't run it, and I was wondering if you had any idea why. My router had been up for 56 days, and I know that I never let it restart without ensuring the ad blocking is working. At some point in, say, the last week or so, it just quit blocking.

    Any ideas? I don't really tinker a lot with my router anymore, so I don't think it was that.

    Thanks!
     
  26. mraneri

    mraneri LI Guru Member

    That's a large list according to the count of hosts at the top. You may need 4MB free (VERY rough estimate) to load that file. Coould be a memory problem.

    What does your log show?

    Also, check your log during the times when it should auto-update. What does it say then?

    Don't bother working to combine the lists till you can know for sure the larger list works... Once we get there, it's probably pretty easy to combine the lists.

    - Mike
     
  27. stud.beefpile

    stud.beefpile Addicted to LI Member

    Dang it

    Well, I perused my log, but could never really identify anything. . .It annoyed me so much being without the ad-blocking (and waiting for pages to load) that I impulsively rebooted, and now have nothing to help in identifying the problem.

    The free memory isn't really a problem, I use a WL-500gPv1.

    The reason I was asking about appending was that a couple of ads at a couple of pages I used to visit were showing up, even after the reboot, and I thought if a lot of domains were good, more would be better.

    I just checked, though, and it appears, they're being blocked and all is well, so until it happens again, nevermind and thank you for your script!
     
  28. mraneri

    mraneri LI Guru Member

    You should still see something like the following in the log. Of course, if it's working, I'm sure it's in there somewhere...

    Code:
    May 29 01:23:06 Router user.notice root: DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt
    May 29 01:23:07 Router daemon.info dnsmasq[3464]: read /etc/hosts - 15152 addresses
    May 29 01:23:07 Router daemon.info dnsmasq[3464]: read /etc/hosts.dnsmasq - 19 addresses
    
    Anyway, glad it's working. (At least for now.)

    - Mike
     
  29. horhe

    horhe Addicted to LI Member

  30. dz0ny

    dz0ny Addicted to LI Member

    I am using this script, google app engine app source is in http://razvoj.dz0ny.info:8080/p/gae-bash-ad-blocker/source/tree/master/

    Code:
    sleep 5
    if [ ! -e /tmp/strezniki ] ; then
    	logger ADBLOCK Prenasam
    	wget http://trohaj.appspot.com/strezniki -O /tmp/strezniki
    	logger ADBLOCK Prenesel      
    	ln -s /tmp/strezniki /etc/dnsmasq.custom
    fi
    
    if [ ! -e /tmp/pixelserv ] ; then
    	wget http://trohaj.appspot.com/pixelserv -O /tmp/pixelserv
    	chmod +x /tmp/pixelserv
    
    fi
    
    killall -9 dnsmasq
    killall -9 pixelserv
    sleep 5
    /tmp/pixelserv
    dnsmasq
    
     
  31. mstombs

    mstombs Network Guru Member

  32. i1135t

    i1135t Network Guru Member

    Is there any difference with the v7 for tomato and v9 for DDWRT you posted? The v7 you posted for tomato works fine, except I do notice little lag when blocking ads on some random webpages. Sometimes the page doesn't even respond and I have to refresh the browser. Not sure if it's just me or if it's happening to other ppl who use this also. Otherwise, a great contribution mstombs. Thanks.
     
  33. mstombs

    mstombs Network Guru Member

    I'll update the tomato thread with a pixelserv version compiled for Tomato. I don't think Tomato users need the "inetd" option, but would be interested to know if the other streamlining attempts work differently, and it has an option to specify the listening IP address. The only issue I know is that some websites look for javascripts on the blocked hosts and the browser doesn't think much of a 1*1 gif in place of a script.
     
  34. Dashiell

    Dashiell Network Guru Member

    Issues with script in newer versions/FIX!

    Okay, here's how this whole thing came about...


    I had been using this adblock script for years.

    It seems, however, in the newest tomato/dnsmasq versions (with the new 2.6 kernel) a problem arose:

    The script will run fine on boot. If you release and renew the wan it still works fine. However, if you're on a DHCP leased WAN (cable companies, etc) when the wan lease runs out and renews, the evidence indicates that dnsmasq is restarted in a different way than all of the other methods, as it wipes out and re-creates the hosts file, ruining the adblock script.

    To explain further:

    The script creates and then runs an executable file in tmp called dlhosts. When it runs, it downloads the host list, cleans it up and then creates the hosts file in /etc. The killall -1 then forces dnsmasq to restart with the newly populated hosts file. So far, so good.

    If you manually release and renew the wan, no problem. When the wan lease runs out and reconnects, however, the hosts file is wiped out and recreated with 2 entries: the home (127.0.0.1) and the address of the router. The downloaded hosts file is now gone and because the hosts file exists with ANY content at all, the "check" portion of the wan up script is fooled into thinking all is well. The end result is that the ad block is now broken.

    Because of this, I tried another script, which didn't really work too well for me. I decided to try and fix the script that had worked for all this time...

    So, here's how I fixed it:

    I'm using beta49 of Teddy's on an RT-N16.

    In the WAN UP script, the line that creates the executable file was changed, so that when run it would create a file called "blkhosts" instead of "hosts". (/etc/blkhosts) I did this by simply changing the file name in the wan up script from /etc/hosts to /etc/blkhosts. This will create the exact same executable (/tmp/dlhosts), with the one small change.

    This would solve the problem of the host file being rewritten, but now I had to make sure that dnsmasq recognized it as a legit hosts file. In the dnsmasq custom configuration box, I added:

    addn-hosts=/etc/blkhosts

    So, when the router boots, it naturally throws the error that the file cannot be found, but after the wan up script is complete, the file is created and then dnsmasq is restarted with "killall -1 dnsmasq". Voila. This method now guarantees that the blocking file will be read by dnsmasq regardless of the method used to restart it. Dnsmasq can wipe the /etc/hosts file all the livelong day, and it won't make a difference.

    I also removed the cru statement in the original script, in order to have a greater control over the process that updates the blocked hosts. I prefer to do it manually rather than have it hit the site once a week (or set a scheduler job to do so).

    I hope this helps anyone in a similar position, and a great deal of thanks to the OP for this excellent script!
     
  35. AtTheAsylum

    AtTheAsylum LI Guru Member

    Thanks for the excellent fix :) I only had one small issue - when trying to access /etc/blkhosts dnsmasq complains with a permission denied message.

    To fix this I added "chmod 777 /etc/blkhosts" into the script between the change you suggested and the logger command.

    You end up with:
    .....> /etc/blkhosts\nchmod 777 /etc/blkhosts\nlogger DOWNLOADED.....

    Kev.
     
  36. FattysGoneWild

    FattysGoneWild LI Guru Member

    I am on cable and using the script that the OP made. This problem does not happen using the 2.4 kernel right and being on cable?

     
  37. Bill_S

    Bill_S Network Guru Member

    Can anyone point me to the most up to date version of this adv blocking script? I would like to install it on my WRT54GS v1.1 router but I am not sure if the script on the first page of this posting is the most current.
    Thanks
     
  38. mraneri

    mraneri LI Guru Member

    The first post does give all the information you need to use the script. If you want to use a whitelist (to EXCLUDE sites from BLOCKING) follow the link to post #120. Post 120 has the complete script with the whitelist feature. If you don't need the whitelist, the first post is all you need.

    Dashiell's update is important it seems if you are on a Kernel 2.6 firmware mod. If you aren't sure, you probably aren't and probably don't need to worry about it.
    In fact, I am running 1.27 standard firmware version (no mods) and just verified all works as expected.

    In the interest of full disclosure, since this post was written, multiple other scripts have been developed to accomplish predominantly the same thing. There are pros and cons to each method. That being said, I still use the one in this thread (Post #120), and it's the simplest, for sure. I really haven't had the need to change the script much. It still works well for me.

    Good luck!

    - Mike
     
  39. Bill_S

    Bill_S Network Guru Member

    Thanks Mike, just to confirm, I add the script that I quoted below (copied from page 1 of post #120) to my WAN UP for basic no frills adv blocking. Do I need to add anything to the INIT page, Shutdown page or Firewall page?
    By the way, I am running stock Tomato v1.28 and I changed the time in the cru statement in order to avoid conflicts.

     
  40. mraneri

    mraneri LI Guru Member

    Nope. The one script is all you need.

    Check your log, you should see something like:
    Code:
    Dec  3 01:23:06 Router user.notice root: DOWNLOADED http://www.mvps.org/winhelp2002/hosts.txt
    Dec  3 01:23:07 Router daemon.info dnsmasq[105]: read /etc/hosts - 14829 addresses
    Dec  3 01:23:08 Router daemon.info dnsmasq[105]: read /etc/hosts.dnsmasq - 20 addresses
    
    Also, you can try pinging one of the blocked sites (check out http://www.mvps.org/winhelp2002/hosts.txt) and ping any one of them. You should some "destination is invalid" "or "host unreachable" or something like that. That should prove it works.
     
  41. Bill_S

    Bill_S Network Guru Member

    Thanks again Mike, I set it up and it works great.
     
  42. mraneri

    mraneri LI Guru Member

    Excellent.
     
  43. FattysGoneWild

    FattysGoneWild LI Guru Member

    Was this ever fixed with a easier approach? OP would you know anything as well? Maybe someone can update the first post with what the script would look like for 2.6k as well?

     
  44. mraneri

    mraneri LI Guru Member

    I haven't updated it simply because I'm running 1.27 standard tomato. Still is a 2.4 kernel. So it's still working for me. I believe only I can update the first post (excluding the mods) but if someone wants to reply with concise instructions plus the modded script, I'd be happy to update the first post with a link to the right post number.

    - Mike
     
  45. Bill_S

    Bill_S Network Guru Member

    Can this script be run in DD-WRT on a WRT54G v3?
     
  46. eahm

    eahm LI Guru Member

    mraneri, smilespray, thanks for the script.
     
  47. Badders44

    Badders44 LI Guru Member

    Does not overwriting the hosts file cause an issue where you've got "127.0.0.1 localhost" from the hosts file and "0.0.0.0 localhost" from the blkhosts file?
     
  48. eahm

    eahm LI Guru Member

  49. mraneri

    mraneri LI Guru Member

    Thanks. I hadn't seen this. Must have happened over the last few days. Last time the script ran on my router it DL'ed the hosts file fine. Today, the hosts.txt file isn't there. I updated both of my posts (Post #1 and Post #120) with the new URL. Thanks for bringing it to my attention.

    - Mike
     
  50. FattysGoneWild

    FattysGoneWild LI Guru Member

    I am wanting to upgrade my Linksys E4200 to Tomato. I am currently using MVPS hosts file and would like to continue so. That is 1 thing I have been missing with Tomato. This script and how it works. Instead of having to use the host file on each different machine. Can someone please post the proper script to get this working correctly with the newer hardware and 2.6 kernel?
     
  51. mraneri

    mraneri LI Guru Member

    This script is quite simple. I didn't completely follow why anyone was having trouble with the 2.6 kernel. I'm using this with a very recent, though still 2.4 build (a toastman build) and all works well. Perhaps others with recent 2.6 kernel firmwares can comment on whether this script is working for them.
     
  52. eahm

    eahm LI Guru Member

    This one (1st post from mraneri http://www.linksysinfo.org/index.php?threads/auto-dl-hosts-file-and-install.21378/) works well:
    Code:
    logger WAN UP Script Executing
    sleep 5
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
        echo -e "#!/bin/sh\nwget -O - http://winhelp2002.mvps.org/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://winhelp2002.mvps.org/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
        chmod 777 /tmp/dlhosts
        /tmp/dlhosts
    fi
    cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
    Shut down the router after you apply the code, wait 5secs then turn on manually (works here with E4200 and RAF .9007).
     
  53. mraneri

    mraneri LI Guru Member

    Looks the same as mine. Glad to know it does actually work... Thanks for posting...
     
  54. eahm

    eahm LI Guru Member

    It's yours, remember I notified you about the new URL? I've been using it for months. Sorry there was no mention (edited).
     
  55. FattysGoneWild

    FattysGoneWild LI Guru Member

    So the original script does in fact work fine with the Linksys E4200 eh? The reason why I asked was because of this post. So, I had assumed it did not work with the new hardware/2.6 kernel.

    eahm,

    The version of firmware you are running with the E4200. That is the exact version I want to upgrade to. Glad to see the script is working. Curious and just making sure. You don't see any errors in the log when it runs correct? And instead of shutting it down. Would a reboot be sufficient?

     
  56. mraneri

    mraneri LI Guru Member

    My Lease is 7 days (per my ISP). Perhaps others have long leases as well which is why they don't have problems on 2.6? Or the above behavior was a bug which has been fixed. Either way, you are free to do what he says.

    Edit the script and change the /etc/hosts to /etc/blkhosts and add the configuration line to the dnsmasq config block. That should work with no problem too. It's up to you whether you want to remove the cru line or leave it in.
     
  57. eahm

    eahm LI Guru Member

    It seems the 9007 has problems, my suggestion: wait for a stable 9008+ and keep the 9006 for now.

    No errors on logs so far, also I don't check very often.

    Reboot works, check the CPU %, when it drop to ~1% it means the script is loaded.

    edit: Shibby mod doesn't unload the script/s every time you modify the settings. Other mods need to be restarted. Some setting change will unload the script, WiFi for example.
     
  58. eahm

    eahm LI Guru Member

    To make it simple for everyone:

    This one, the original script from mraneri, works:
    Code:
    logger WAN UP Script Executing
    sleep 5
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
        echo -e "#!/bin/sh\nwget -O - http://winhelp2002.mvps.org/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://winhelp2002.mvps.org/hosts.txt\nkillall -1 dnsmasq" > /tmp/dlhosts
        chmod 777 /tmp/dlhosts
        /tmp/dlhosts
    fi
    cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
    This one, with custom whitelist from mraneri, works:
    Code:
    logger WAN UP Script Executing
    sleep 5
     
    cat > /tmp/whitelist <<EOF
    test.com
    test2.com
    EOF
     
    test -s /tmp/dlhosts
    if [ $? == 1 ] ; then
        echo -e "#!/bin/sh\nURL=http://winhelp2002.mvps.org/hosts.txt\nwget -O - \$URL | grep 127.0.0.1 | grep -Fvf /tmp/whitelist | sed -e '2,\
     
    $s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/hosts\nlogger DOWNLOADED \$URL\nkillall -1 dnsmasq" > /tmp/dlhosts
        chmod 777 /tmp/dlhosts
        /tmp/dlhosts
    fi
    cru a Gethosts "45 23 * * 5 /tmp/dlhosts"
    This one, with custom whitelist and blacklist from smilespray, doesn't work. Please fix it, it may be useful:
    Code:
    logger WAN UP Script Executing
    sleep 5
     
    cat > /tmp/whitelist <<EOF
    int.sitestat.com
    EOF
     
    sed 's/^\(.*\)$/0.0.0.0  \1/g' > /tmp/blacklist <<EOF
    annonser.dagbladet.no
    db-admatch.osl.basefarm.net
    EOF
     
    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 | grep -Fvf /tmp/whitelist | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' | cat - /tmp/blacklist > /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"
     
  59. zong

    zong Serious Server Member

  60. Bill_S

    Bill_S Network Guru Member

    Could someone post a few sites that would allow me to test to see if the script is working?
    Thanks
     
  61. eahm

    eahm LI Guru Member

    Any porn or warez website.

    ...actually even YouTube:

    [​IMG]
     
  62. Bill_S

    Bill_S Network Guru Member

    I tried YouTube and I got the advertisment at the top of the page. Does that mean that my script is not blocking as it should? I entered the following in my browser https://www.youtube.com/
     
  63. eahm

    eahm LI Guru Member

  64. Bill_S

    Bill_S Network Guru Member

    1) Using the one listed under this heading, This one, the original script from mraneri, works:

    2) Yes inserted in "Wan Up".

    3) Router restarted

    4) Cache cleared

    5) Ran /tmp/dlhosts and received the following:
    sed: unmatched '/'
    Connecting to winhelp2002.mvps.org (216.155.126.40:80)
    - 0% | | 4075 00:02:26 ETA - 67% |******************** | 395k 00:00:00 ETA - 100% |*******************************| 586k 00:00:00 ETA
     
  65. eahm

    eahm LI Guru Member

    Try with different browsers or any porn or warez (es: http://9down.com) website. The cache makes you think it doesn't work. For example, clearing the cache on Chrome is not enough, you have to close it and terminate the process.
     
  66. Bill_S

    Bill_S Network Guru Member

    Cleared cache in IE, Firefox and Waterfox then closed and restarted even cleared DNS cache and ran CCleaner but still get ad's. Are there any additional settings in the router that need to be configured? I have an ASUS RT-N16 running Tomato Firmware v1.28.7500 MIPSR2Toastman-RT K26 USB Ext. I used (es: http://9down.com) to test.
    Did the command I ran tell you anything, is the list being downloaded and installed?
    Thanks for the help.
     
  67. eahm

    eahm LI Guru Member

    Yes the command works, if it doesn't it gives you an error.
     
  68. Bill_S

    Bill_S Network Guru Member

    How about router settings, or PC settings? Right now I am using 4.2.2.5, 4.2.2.4 & 204.97.212.10 as DNS servers. Are there any other setting that might cause this to happen?
     
  69. zong

    zong Serious Server Member

    This has nothing to do with the DNS server. I have the "original" script running with my adapted "Maleware host" and blocking works well. I can check via PING (under tools). I you go to LOGS you will get.... (see downloaded and xxxx addresses)

    QUESTION: Does anybody KNOW what the error HTB: Quantum of class ..is big - MEANS ???

    Sep 22 23:05:35 unknown user.notice root: WAN UP Script Executing
    Sep 22 23:05:36 unknown user.warn kernel: HTB: quantum of class 10001 is big. Consider r2q change.
    Sep 22 23:05:36 unknown user.warn kernel: HTB: quantum of class 40001 is big. Consider r2q change.
    Sep 22 23:05:36 unknown cron.err crond[580]: time disparity of 22472464 minutes detected
    Sep 22 23:05:42 unknown user.notice root: DOWNLOADED http://www.malwaredomainlist.com/hostslist/hosts.txt
    Sep 22 23:05:42 unknown daemon.info dnsmasq[617]: read /etc/hosts - 1997 addresses
    Sep 22 23:05:42 unknown daemon.info dnsmasq[617]: read /etc/dnsmasq/hosts/hosts - 5 addresses
    Sep 22 23:05:42 unknown daemon.info dnsmasq-dhcp[617]: read /etc/dnsmasq/dhcp/dhcp-hosts
     
  70. Bill_S

    Bill_S Network Guru Member

    I have the following in my log and I get no blocking:
    Sep 22 10:27:53 unknown user.notice root: WAN UP Script Executing
    Sep 22 10:27:58 unknown user.notice root: DOWNLOADED http://winhelp2002.mvps.org/hosts.txt
    Sep 22 10:27:58 unknown daemon.info dnsmasq[528]: read /etc/hosts - 0 addresses
    Sep 22 10:27:58 unknown daemon.info dnsmasq[528]: read /etc/dnsmasq/hosts/hosts - 3 addresses
    Sep 22 10:27:58 unknown daemon.info dnsmasq-dhcp[528]: read /etc/dnsmasq/dhcp/dhcp-hosts
     
  71. zong

    zong Serious Server Member

    0 addresses - IS WRONG / so why so ever the script is not converting the downloaded file and could not read in hosts. No idea :-( // double check the script - maybe use without last line staring with CRU. This is just for update.
    Do a RESET with the router and check again.
     
  72. mraneri

    mraneri LI Guru Member

    It seems on some systems, writing to /etc/hosts is a problem, either because other scripts/processes overwrite it, or for some other reason the file gets wiped. I don't know who, how, or why. But it doesn't matter. There's an easy fix:

    Download the file into a file other than /etc/hosts, and tell dnsmasq to include that file as well..
    Search the script for "\etc\hosts" and replace with "etc\blkhosts"

    then, in Advanced -> DHCP/DNS -> dnsmasq custom configuration, add:
    Code:
    addn-hosts=/etc/blkhosts
    Reboot the router.

    You may see something like this in the logs immediately after reboot:
    Code:
    router daemon.info dnsmasq[503]: read /etc/hosts - 2 addresses
    router daemon.info dnsmasq[503]: read /etc/dnsmasq/hosts/hosts - 27 addresses
    router daemon.err dnsmasq[503]: failed to load names from /etc/blkhosts: No such file or directory
    
    But after a few minutes, the router should download the hosts file, and you should get something like this:
    Code:
    router user.notice root: DOWNLOADED ADBLOCK HOSTS FILE(s)
    router daemon.info dnsmasq[503]: read /etc/hosts - 2 addresses
    router daemon.info dnsmasq[503]: read /etc/dnsmasq/hosts/hosts - 27 addresses
    router daemon.info dnsmasq[503]: read /etc/blkhosts - 14777 addresses
    router daemon.info dnsmasq-dhcp[503]: read /etc/dnsmasq/dhcp/dhcp-hosts
    
     
  73. Bill_S

    Bill_S Network Guru Member

    Mraneri, I made the changes you suggested and this is the result.

    It still seems as if it is not working.
     
  74. mraneri

    mraneri LI Guru Member

    Put the following in Tools -> System -> Command: and press execute: This will give us a file list of etc directory and beginning and end of blkhosts file.

    Code:
    ls -l /tmp/etc
    head /tmp/etc/blkhosts
    tail /tmp/etc/blkhosts

    (Paste the output into a CODE block when you reply)
     
  75. Bill_S

    Bill_S Network Guru Member

    Got it to work, went back to the first post of this thread and copied that script into WAN Up and removed the one that was giving me the problem. Then rebooted the router by powering it off and then on. Once I did that I got the following in the log.
    Now when I go to YouTube the ad is blocked and when I try to ping anything on the list it does not find the host.
    Thanks for all the help.
     
  76. mraneri

    mraneri LI Guru Member

    Glad it's working (but curious what was wrong!)
    Thanks for updating us.

    - Mike
     
  77. Bill_S

    Bill_S Network Guru Member

    Can I give you anything that might help you find out what went wrong?
     
  78. pharma

    pharma Network Guru Member

    Mike,
    I just installed your script in 1st post with excellent results! I had just about reached my "breaking point" with regard to Ads.

    Thank you for sharing your wonderful script!

    Pharma
     
  79. mraneri

    mraneri LI Guru Member

    My pleasure. I'm happy to share, and glad people find my stuff useful.
     
  80. mraneri

    mraneri LI Guru Member

    If you have the text of the old script that didn't work, you can PM it to me. If I have a chance, I'll take a look and see if I can figure out why it wasn't working. No need to bother the rest of the forum with the details. If I figure anything else out that may help others, I'll post what I found.
     
  81. pharma

    pharma Network Guru Member

    Everything is working perfectly! Just one thing to share -- after pasting and saving your script, re-booting the router was necessary to block all Ad's. Not sure a manual re-boot is required but without it I noticed Ads still appeared on some sites. It's possible I missed this step in the post #1.

    Pharma
     
  82. mraneri

    mraneri LI Guru Member

    My suspicion is it has to do with what's in the cache at the time (both in the router's cache and your computer's). But not sure. Glad it's working for you.
     
  83. zong

    zong Serious Server Member

    addn-hosts=/etc/blkhosts seems to be a good idea ! As already posted the "original script" is good running
    -however if I do reconnect -or changing parameters on router, the "hosts" seems to be overwritten. (with reboot - it comes back)
    With this fix - great :) I am not using the updatefunction in cript as with "scheduler" in firmware you can do "reconnect" which should also update the script (and ip).
    @mraneri: Is it possible to include a SECOND link with from xyzhost.txt to this script.
    PS: for those who a looking foreward to ADD an personal BLACKLIST, just add this the "dnsmasq custom" (links can be changed)
    address=/partner.googleadservices.com/0.0.0.0
    address=/google-analytics.com/0.0.0.0
    address=/googlepages.com/0.0.0.0
    address=/googlesyndication.com/0.0.0.0
    address=/doubleclick.com/0.0.0.0
    address=/doubleclick.net/0.0.0.0
     
    eahm likes this.
  84. mraneri

    mraneri LI Guru Member

    EDITED 4/19/2014 - Updated path where hosts file is stored so it is automatically picked up by dnsmasq with no need for a configuration option.
    Yeah. I set this up a few months ago. Here's the script I'm using now. Includes whitelist support and handles two hosts files.
    Works!!

    Code:
    cat > /tmp/whitelist <<EOF
    whitelist1.com
    whitelist2.com
    EOF
    
    if [ ! -s /tmp/dlhosts ] ; then
    
    echo -e "#!/bin/sh\n(wget -O - http://winhelp2002.mvps.org/hosts.txt ; wget -O - http://jamesisbored.com/iphone/content/hosts.php) | grep .0.0. | grep -Fvf /tmp/whitelist | sed -e '2,\$s/127.0.0.1/0.0.0.0/g' -e 's/[[:space:]]*#.*$//' > /etc/dnsmasq/hosts/blkhosts\nlogger 'DOWNLOADED ADBLOCK HOSTS FILE(s)'\nkillall -1 dnsmasq" > /tmp/dlhosts
    chmod 777 /tmp/dlhosts
    sleep 120
    /tmp/dlhosts
    fi
    cru a GethostsFriAM "23 3 * * 2 /tmp/dlhosts"
    Don't forget to tweak your cru line to DL the files at a different time. Be friendly to the hosts...

    This one downloads:
    http://winhelp2002.mvps.org/hosts.txt
    http://jamesisbored.com/iphone/content/hosts.php

    The second one is a short list which does a good job of blocking mobile ads on phones/tablets/iPods, etc.. (http://jamesisbored.com/iphone/adblock)
    Have fun!
     
    Last edited: Apr 19, 2014
    zbeyuz and eahm like this.
  85. eahm

    eahm LI Guru Member

    It didn't work for me, it actually disables the first one too, am I missing something?
     
  86. mraneri

    mraneri LI Guru Member

    Hmm...
    Put this in Tools -> System -> Command:
    Code:
    ls -l /tmp
    /tmp/dlhosts
    Click execute, and post the result here. Also, show the lines in the log which are generated (from the same time that you click Execute.)
     
  87. eahm

    eahm LI Guru Member

    Code:
    -rwxrwxrwx    1 root    root          282 Sep 24 19:27 dlhosts
    drwxr-xr-x    5 root    root          600 Sep 24 19:27 etc
    drwxr-xr-x    3 root    root            60 Dec 31  1969 home
    drwxr-xr-x    2 root    root            40 Dec 31  1969 mnt
    -rwx------    1 root    root          511 Sep 24 19:27 script_wanup.sh
    drwxr-xr-x    2 root    root            40 Dec 31  1969 share
    drwxr-xr-x    2 root    root            40 Dec 31  1969 splashd
    -rwxr-xr-x    1 root    root          126 Dec 31  1969 stop_transmission.sh
    drwxr-xr-x  11 root    root          220 Dec 31  1969 var
    -rw-r--r--    1 root    root            30 Sep 24 19:27 whitelist
    Connecting to winhelp2002.mvps.org (216.155.126.40:80)
     
    -                    14% |****                          | 86611  00:00:05 ETA
    -                    100% |*******************************|  586k 00:00:00 ETA
    Connecting to www.ismeh.com (173.236.224.212:80)
     
    -                    100% |*******************************| 11826  --:--:-- ETA
    It downloads but the ads are still there.
     
  88. mraneri

    mraneri LI Guru Member

    In Advanced -> DHCP/DNS -> dnsmasq custom configuration, you need to add:
    Code:
    addn-hosts=/etc/blkhosts
    Did you do that already?
     
    eahm likes this.
  89. eahm

    eahm LI Guru Member

    I didn't sorry, it works perfectly now thanks.
     
    mraneri likes this.
  90. eahm

    eahm LI Guru Member

    Can you add to the same one a custom blacklist?
     
  91. mraneri

    mraneri LI Guru Member

    zong, Post 183 above has a good solution you can implement right now. I have to think about an easy way to add a black list. But for now, you can use his solution.. Just adds on to mine via a few other entries in dnsmasq config. Should work well.
     
    eahm likes this.
  92. zong

    zong Serious Server Member

    @mraneri - THX this is now perfect (for me)
    Last question :)
    The addresses of the host file all begins with 127.x.x.x. and your script is cleaning & changing them to 0.0.0.0.
    What will happen with those hosts-file lists without 127.x.x.x. (like http://isc.sans.edu/feeds/suspiciousdomains_Medium.txt)

    Would the script also work and reform those to 0.0.0.0 or is really and "original file needed starting with 127.x.x.x)
     
  93. mraneri

    mraneri LI Guru Member

    The changing to 0.0.0.0 was to speed up some browsers which recognize 0.0.0.0 is not a good IP address immediately instead of trying to connect to 127.0.0.1.

    For your hosts file without 127.x.x.x, it can be done, but not with the script currently. Some "sed" statement can add the 0.0.0.0 to the beginning. But for now, the script doesn't do that, so it won't work if you add that one. Maybe at some point I can update this.
     
  94. zong

    zong Serious Server Member

    thx /understood -would be great to see this script developing :)
    With regard to 0.0.0.0 is this also relevant for the dnsmasq entries (blacklist) I made. Should they also direct to 0.0.0.0 or is here 127.x.x.x needed ?
     
  95. mraneri

    mraneri LI Guru Member

    I may look at mods to make the "suspiciousdomains" list compatible. Note, also, there is another script which is much more further developed... And is much more complicated as well. You may want to check that out as well. Search for "All-U-Need ad blocking". I haven't really found the need or the benefit to switch. I've been using the script here since before I started this thread in 2007, and it has never broken. (Except once when the MVPS list moved.) Everyone has their own preferences. I prefer this simple one. Some others prefer the alternatives.
    I think you are ok with either. I would use 0.0.0.0 and verify it works.
     
  96. zong

    zong Serious Server Member

    thx again. I have also seen the All-U-Need script, however it uses pixelserv.
    Maybe a bit complex for me and I have low NVRAM so was fine with your script.
    Do you know if there a any plan by shibby/toastman/etc to implement pixelserv in their builds ?
    Do you see/ and agree to the benefits of "sendig back" instead of blocking.
    I have seen this which tries to explain.
    http://cohomology.wordpress.com/2010/12/02/adblock-for-tomato-routers/
     
  97. zong

    zong Serious Server Member

    maybe good to check. I have a lot of those entries since my "custom dnsmasq" entries.....
    DHCPREQUEST...... (br1) is my guest network.
    Is this normal for "every" login into the network ??

    Sep 30 08:00:15 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 08:00:15 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 08:00:15 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 08:00:15 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 09:13:29 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:13:29 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:23:44 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:23:44 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:23:51 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:23:51 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:32:59 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:32:59 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:52:29 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 09:52:29 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:00:01 unknown syslog.info root: -- MARK --
    Sep 30 09:00:17 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 09:00:17 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 09:00:17 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 09:00:17 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 10:12:04 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:12:04 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:22:24 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:22:24 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:22:32 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:22:32 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:33:24 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:33:24 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:53:03 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 10:53:03 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:00:01 unknown syslog.info root: -- MARK --
    Sep 30 10:00:52 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 10:00:52 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 10:00:52 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 10:00:52 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 11:12:38 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:12:38 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:19:28 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:19:28 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:32:08 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:32:08 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:51:26 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br0) 192.168.1.100 80:1f:02:25:4d:xx
    Sep 30 11:51:26 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:47 meinPC
    Sep 30 11:51:30 unknown daemon.info dnsmasq-dhcp[584]: DHCPINFORM(br0) 192.168.1.100 80:1f:02:25:4d:xx
    Sep 30 11:51:30 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:xx meinPC
    Sep 30 11:51:43 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:51:43 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:57:19 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 11:57:19 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:00:01 unknown syslog.info root: -- MARK --
    Sep 30 11:01:13 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 11:01:13 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 11:01:13 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 11:01:13 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 12:01:20 unknown daemon.info dnsmasq-dhcp[584]: DHCPINFORM(br0) 192.168.1.100 80:1f:02:25:4d:xx
    Sep 30 12:01:20 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:47 meinPC
    Sep 30 12:13:18 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:13:18 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:13:33 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.8 c8:bc:c8:74:7f:51
    Sep 30 12:13:33 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.8 c8:bc:c8:74:7f:51
    Sep 30 12:13:44 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:13:44 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:22:23 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:22:23 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:25:03 unknown daemon.info dnsmasq-dhcp[584]: DHCPINFORM(br0) 192.168.1.100 80:1f:02:25:4d:47
    Sep 30 12:25:03 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:xx meinPC
    Sep 30 12:26:20 unknown daemon.info dnsmasq-dhcp[584]: DHCPINFORM(br0) 192.168.1.100 80:1f:02:25:4d:47
    Sep 30 12:26:20 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:xx meinPC
    Sep 30 12:32:08 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:32:08 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:41:54 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:41:54 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:51:38 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:51:38 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:56:49 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:56:49 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:00:01 unknown syslog.info root: -- MARK --
    Sep 30 13:01:23 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:01:23 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 12:01:32 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 12:01:32 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 12:01:32 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 12:01:32 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 13:11:09 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:11:09 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:16:58 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:16:58 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:26:49 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 13:26:49 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br1) 192.168.2.7 d8:9e:3f:70:9a:4b
    Sep 30 14:00:01 unknown syslog.info root: -- MARK --
    Sep 30 13:01:42 unknown daemon.info dnscrypt-proxy[606]: Refetching server certificates
    Sep 30 13:01:42 unknown daemon.info dnscrypt-proxy[606]: Server certificate #1346958918 received
    Sep 30 13:01:42 unknown daemon.info dnscrypt-proxy[606]: This certificate looks valid
    Sep 30 13:01:42 unknown daemon.info dnscrypt-proxy[606]: Server key fingerprint is 6228:62A6:CA4D:F1E8:37A7:C486:4F66:E692:0B5E:34F8:B110:597D:5BA0:BAB6:AF03:FA75
    Sep 30 14:02:11 unknown daemon.info dnsmasq-dhcp[584]: DHCPREQUEST(br0) 192.168.1.100 80:1f:02:25:4d:xx
    Sep 30 14:02:11 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:xx meinPC
    Sep 30 14:02:13 unknown daemon.info dnsmasq-dhcp[584]: DHCPINFORM(br0) 192.168.1.100 80:1f:02:25:4d:47
    Sep 30 14:02:13 unknown daemon.info dnsmasq-dhcp[584]: DHCPACK(br0) 192.168.1.100 80:1f:02:25:4d:xx meinPC
     
  98. zbeyuz

    zbeyuz Serious Server Member

    Same problem as above post. I am using mraneri 's script.

    Btw, Does anyone know how to add secure lists start with https. For example: https://adversity.googlecode.com/hg/Adversity.txt

    My router, which is Asus RT-N66U run tomato Shibby version, always say can't read from https address.

    Any solutions are welcome.
     
  99. zbeyuz

    zbeyuz Serious Server Member

    ***Update:
    Here is what I got from Tools ---> System:
    The last two hosts cannot be downloaded ?


    -rwxrwxrwx 1 root root 616 Oct 1 01:16 dlhosts
    drwxr-xr-x 5 root root 680 Oct 1 01:20 etc
    drwxr-xr-x 3 root root 60 Jan 1 1970 home
    drwxr-xr-x 3 root root 60 Jan 1 1970 mnt
    -rwx------ 1 root root 873 Oct 1 01:16 script_wanup.sh
    drwxr-xr-x 2 root root 40 Jan 1 1970 share
    drwxr-xr-x 2 root root 40 Jan 1 1970 splashd
    -rwxr-xr-x 1 root root 126 Jan 1 1970 stop_transmission.sh
    drwxr-xr-x 11 root root 220 Jan 1 1970 var
    -rw-r--r-- 1 root root 17 Oct 1 01:16 whitelist
    Connecting to winhelp2002.mvps.org (216.155.126.40:80)

    - 1% | | 9951 00:00:59 ETA
    - 15% |**** | 91711 00:00:11 ETA
    - 58% |***************** | 341k 00:00:02 ETA
    - 89% |*************************** | 528k 00:00:00 ETA
    - 100% |*******************************| 586k 00:00:00 ETA
    Connecting to www.ismeh.com (173.236.224.212:80)

    - 42% |************* | 5604 00:00:01 ETA
    - 100% |*******************************| 11826 00:00:00 ETA
    Connecting to hosts-file.net (173.192.78.69:80)

    - 1% | | 3993 00:01:30 ETA
    - 23% |******* | 85469 00:00:06 ETA
    - 66% |******************** | 236k 00:00:01 ETA
    - 100% |*******************************| 353k 00:00:00 ETA
    Connecting to www.fanboy.co.nz (199.27.135.184:80)

    - 100% |*******************************| 274k --:--:-- ETA
    Connecting to www.fanboy.co.nz (141.101.124.185:80)

    Connecting to www.fanboy.co.nz (199.27.135.184:80)
     
  100. zong

    zong Serious Server Member

    dear zbeyuz, as mentioned above this script "only" works for host-file (meaning beginning with 127.x.x.x). There are also lists available without this prefix and special block-lists for adblock+ (this is your example).
    You need to stick to the defined HOST-file format
     

Share This Page