Skip to content

Instantly share code, notes, and snippets.

@miekg
Created August 25, 2013 23:45
Show Gist options
  • Save miekg/6337012 to your computer and use it in GitHub Desktop.
Save miekg/6337012 to your computer and use it in GitHub Desktop.
#!/bin/bash
KEYDIR=/etc/bind/external/keys
DSDIR=/etc/bind/external/ds
ZONES="miek.nl atoom.net dnssex.nl dnsex.nl"
cd "$1"
for z in $ZONES; do
if [ -e $z.nsec3 ]; then
# sign with NSEC3
/usr/sbin/dnssec-signzone -P $(grep -v '^\#' $z.nsec3) -N \
unixtime -K $KEYDIR -d $DSDIR -o $z -S $z >/dev/null 2>&1
else
/usr/sbin/dnssec-signzone -P -N unixtime -K $KEYDIR -d \
$DSDIR -o $z -S $z >/dev/null 2>&1
fi
/bin/chown bind.bind "$z.signed"
done
/usr/sbin/rndc reload >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment