11
Bulk Update DNS zone files serial
Filed Under (cPanel/WHM, DirectAdmin, Linux) by WebScHoLaR on 11-12-2010
Tagged Under : bind, dns, named, serial, zone file
DNS zone files in Bind are refreshed by increasing the serial number that is in the format yyyymmddXX (e.g 2010121101 i.e 11th December, 2010 and serial number is 01). In case all DNS zone files on the server need to be refreshed by incrementing serial number, this can be done as:
for i in `ls /var/named/*.db` ; do cat $i | sed ‘s/[0-9]\{10\}/2010121101/g’ > $i.new; mv -f $i.new $i; chown named.named $i ;done
This will set serial for all DNS zone files to 2010121101. Make sure to reload BIND after wards as:
[root@System ~]# rndc reload
server reload successful
