Could we help you? Please click the banners. We are young and desperately need the money
The following simple script will scrape through all the registered BIND zones and execute the retransfer command for every single zone in just one simple loop:
#! /bin/bash
TIME_START=$(date +"%s")
RNDC="/usr/sbin/rndc"
ls /var/lib/bind/*.hosts | while read zf; do basename $zf .hosts ; done | while read zone ; do
${RNDC} retransfer ${zone}
done
TIME_DIFF=$(($(date +"%s")-${TIME_START}))
echo "Zone Retransfer finished in $((${TIME_DIFF} / 60)) Minutes and $((${TIME_DIFF} % 60)) Seconds."