Skip to content

Instantly share code, notes, and snippets.

@Mostly-BSD
Created April 9, 2021 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mostly-BSD/46101bcd4c7f05527c45769d7f9edc94 to your computer and use it in GitHub Desktop.
Save Mostly-BSD/46101bcd4c7f05527c45769d7f9edc94 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
cd /tmp
fetch https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
echo "server:" > /usr/local/etc/unbound/ads.conf
cat hosts | grep '^0\.0\.0\.0' | awk '{print "local-zone: \""$2"\" redirect\nlocal-data: \""$2" A 0.0.0.0\"\nlocal-data: \""$2" AAAA ::\"\n"}' >> ads.conf
rm -f hosts
service unbound restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment