Unbound - Werbeblocker



  • Den Unbound DNS-Server kann man auch prima als Werbeblocker benutzen.

    Screenshot_20190729-201229.png

    /usr/bin/wget -N https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
    /usr/bin/wget -N https://download.dnscrypt.info/blacklists/domains/mybase.txt
    /usr/bin/wget -N https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
    cat hosts | grep '^0\.0\.0\.0' | awk '{print $2}' > block
    sed '/#/d; /*/d; /^$/d; /^\./d' mybase.txt > mybase
    cat block mybase | sort -u > merged
    touch /home/heat/mywhitelist
    cat whitelist.txt /home/heat/mywhitelist | sort -u > whitelist
    comm -23 merged whitelist > merged_corr
    awk '{print "local-zone: \""$1"\" refuse"}' merged_corr > /etc/unbound/unbound.conf.d/blocklist.conf
    

    Das Script ist leicht angepasst.

    Quelle des Scriptes: https://www.wilderssecurity.com/threads/adblocking-with-unbound.406346/

    Aktuell auf dem Server in der Testphase ­čÖé

    Links

    https://github.com/anudeepND/whitelist

    https://download.dnscrypt.info/

    https://github.com/search?q=StevenBlack



  • Als Script

    #!/bin/bash
    ###############################################################################$
    #
    ###############################################################################$
    /usr/bin/wget -N https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
    /usr/bin/wget -N https://download.dnscrypt.info/blacklists/domains/mybase.txt
    /usr/bin/wget -N https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
    cat hosts | grep '^0\.0\.0\.0' | awk '{print $2}' > block
    sed '/#/d; /*/d; /^$/d; /^\./d' mybase.txt > mybase
    cat block mybase | sort -u > merged
    touch /root/blocklist/mywhitelist
    cat whitelist.txt /root/blocklist/mywhitelist | sort -u > whitelist
    comm -23 merged whitelist > merged_corr
    awk '{print "local-zone: \""$1"\" refuse"}' merged_corr > /etc/unbound/unbound.conf.d/blocklist.conf
    service unbound restart

Log in to reply
 

Diese Artikel k├Ânnten Dich auch interessieren.

  • 2
  • 4
  • 13
  • 1
  • 1
  • 1
  • 1
  • 4