2019-08-13
Decompiling zonefiles
The authoritive nameserver on the homeserver 2017 is using bind9 version 9.10.3 (from Devuan packages). I wanted to look up something in a secondary zonefile and noticed it was a binary file. Using 'file' to determine what to do next wasn't much help:$ file secondary.domain-zone secondary.domain-zone: dataBut a search found an explanation at Reading a binary zone file from Bind - The Linux Page. With named-compilezone a zonefile can be 'uncompiled' to a readable file.$ /usr/sbin/named-compilezone -f raw -F text -o /tmp/secondary.domain-zone.txt secondary.domain secondary.domain-zone zone secondary.domain/IN: loaded serial 2018122523 dump zone to /tmp/secondary.domain-zone.txt...done OK $ file /tmp/secondary.domain-zone.txt /tmp/secondary.domain-zone.txt: ASCII textWhich is a readable zonefile.