Sysadmin shell oneliner: update serial in all DNS zones

Sometimes you just need to force updates on slave DNS servers. The easiest way to do it is to increase zone serials on master server. what if there are hundreds of zone files? Here is one way to do it

Assuming we store DNS zones in /var/named and zone file names are in form domain.com.hosts, here is one liner that should effectively increase serial in all zones (set it to YYYYMMDD01 if it has some other format):

Note new_serial variable – it assumes that there is no zone with serial created from today timestamp. You can replace 01 with some higher number to make sure zones created today will be covered too.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">