Skip to content

Instantly share code, notes, and snippets.

@jmhale
Created April 27, 2022 11:22
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 jmhale/805a85e6b3b7762041c92dea8d3da95f to your computer and use it in GitHub Desktop.
Save jmhale/805a85e6b3b7762041c92dea8d3da95f to your computer and use it in GitHub Desktop.
Convert between Pihole and Unbound custom DNS lists
# Unbound to Pihole
cat unbound/etc-unbound/a-records.conf | awk '{print $4 " " $2}'| tr -d \" | sed 's/\.$//' > pihole/etc-pihole/custom.list
# Pihole to Unbound
cat pihole/etc-pihole/custom.list | awk '{print "local-data: \""$2". A "$1"\""}' > unbound/etc-unbound/a-records.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment