[BlueOnyx:22911] Re: Checking DNS secondary zone files

Christoph Schneeberger cschnee at box.telemedia.ch
Thu May 16 08:27:08 -05 2019


Colin,

On 5/16/19 13:23, Colin Jack wrote:
>>> Found the zone files but can't cat them like I can on earlier versions to check
>> the serial number etc.
>>> Google says the latest versions of bind use raw files?
>>>
>>> I appreciate I am being a bit 'noob' here but I need to confirm that the
>> secondary records have updated - they don't always.
>>
>> Recent versions of bind (>=9.9) can use either raw or text format (can be
>> configured[1]).
>> There is a tool to manually convert between the two formats. See the below url
>> for an explanation and how to convert:
>>
>> https://kb.isc.org/docs/aa-00608
> Yeah saw that on Google but bit of a pain if all I want to do is compare serial numbers of zone records to check they have updated. ☹
While it should be easy to convert all zone files quickly to i.e. 
/tmp/named for inspection with something like the script below, I 
completely agree with you that the little performance advantage of raw 
files over text files justifies the additional work only in a few 
setups, most people probably don't need that little extra boost for 
their DNS setup.

I still use text files for all zones with masterfile-format text; in 
named.conf (though I am not running my DNS servers on BX).

Example script to quickly convert all zone files to text files in 
/tmp/named (untested but should work):

#!/bin/bash --
mkdir /tmp/named
for f in $(find /var/named/chroot/var/named/ -type f); do
   echo "Processing $(basename $f) in $(dirname $f);
   named-compilezone -f raw -F text -o /tmp/named/$(basename $f).txt
done

Cheers - Christoph




More information about the Blueonyx mailing list