Unbound - Werbeblocker
-
Den Unbound DNS-Server kann man auch prima als Werbeblocker benutzen.
/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
GitHub - anudeepND/whitelist: A simple tool to add commonly white listed domains to your Pi-Hole setup.
A simple tool to add commonly white listed domains to your Pi-Hole setup. - GitHub - anudeepND/whitelist: A simple tool to add commonly white listed domains to your Pi-Hole setup.
GitHub (github.com)
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
GitHub (github.com)
-
Als Script
#!/bin/bash ###############################################################################$ # ###############################################################################$ cd /Verzeichnis /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 sed -i '1s/.*$/server:\n&/g' /etc/unbound/unbound.conf.d/blocklist.conf service unbound restart