lowerttls.sh

This script will lower the TTL on a directory full of zone files. I’ve used this with much success on many cPanel servers. I’m not sure how well it would work with other systems. My guess would be that it would work fine on any system using bind.

#!/bin/bash
echo Backing up /var/named
mkdir /home/named.backup
rsync -aq —exclude=proc /var/named /home/named.backup
echo Lowering TTLs…
sed -e ’s/\s14400/ 300/g’ -i /var/named/*.db
echo Reloading zone files…
rndc reload
echo Done!

You will of course need to update the serial as well. I suggest using updateserial from http://cplicensing.net

Leave a Reply

You must be logged in to post a comment.