Christophe Casalegno

Bind : how to modify serial number of all your dns zone with sed

You can simply use the sed command to do this :

Go on your dns zone directory and :

sed -i -e "s/2[0-9]\{9\}/yourserialnumber/g" path_to_your_dns_zone_files/*.hosts

Example :

sed -i -e "s/2[0-9]\{9\}/2012011901/g" /var/lib/named/var/named/master/*.hosts

That’s done, you can just restart bind 🙂

 


Christophe Casalegno
http://twitter.com/Brain0verride
http://www.facebook.com/brain.override

Leave a Comment