This script can be used to increment, sign and reload a domain in BIND 9. It can take a signed or unsigned domain as an argument, and will handle it appropriately.
Written and tested on Debian 9-12.
The script does the following:
- Increments the serial of the domain's zone file
- Checks if the domain is signed by looking in $BINDZONECONF
- Re-signs the domain (if it was previously signed)
- Reloads BIND for the domain (rndc reload [DOMAIN])