Skip to content

Instantly share code, notes, and snippets.

@origamiofficial
Last active August 5, 2022 11:01
Show Gist options
  • Save origamiofficial/5f3f7ca684decdb16376561d19b9b853 to your computer and use it in GitHub Desktop.
Save origamiofficial/5f3f7ca684decdb16376561d19b9b853 to your computer and use it in GitHub Desktop.
Unbound root hints automatically updater script. After updating the root.hints file, this script will restart Unbound & Pi-hole for smoother operations. Add this cron entry to run the script at 3 AM on the 1st day of every month: "0 3 1 */1 * root /bin/bash /This/Scripts/Location/UnboundRootHintsUpdate.sh"
#!/bin/sh
RootHintsLocation="/var/lib/unbound/root.hints"
# Unbound Root.hints Update
/usr/bin/wget -O "$RootHintsLocation" https://www.internic.net/domain/named.root >/dev/null 2>&1
service unbound restart && pihole restartdns >/dev/null 2>&1
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment