Skip to content

Instantly share code, notes, and snippets.

@p3ngu1n-net
Created May 30, 2022 11:53
Show Gist options
  • Save p3ngu1n-net/b953b1e5a1f1676dcc87ba5008b6bc5a to your computer and use it in GitHub Desktop.
Save p3ngu1n-net/b953b1e5a1f1676dcc87ba5008b6bc5a to your computer and use it in GitHub Desktop.
Downloads & processes OISD Full Domain list for using in Unbound DNS resolver
#!/bin/sh
printf "Downloading OISD Full Domain list... "
curl "https://dbl.oisd.nl/" -o oisd-dbl.txt 2> /dev/null
printf "done\nProcessing list... "
grep -v "#" oisd-dbl.txt | grep "." | awk '{print "local-zone: \""$1"\" always_nxdomain"}' > oisd.conf
rm -f oisd-dbl.txt
printf "done\n"
printf "Moving list to unbound directory... \n"
rm /etc/unbound/oisd.conf
cp oisd.conf /etc/unbound/oisd.conf
printf "Restarting unbound... \n"
systemctl restart unbound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment