BIND Convert Slave Raw Format

In Bind v9.9.0 the default option for zone file format on a slave is a raw binary format. For troubleshooting these can be converted back to text using named-compilezone. An example is shown below:

/usr/sbin/named-compilezone -f raw -F text -o /tmp/zone.domainname.co.uk domainname.co.uk /var/named/data/zone.domainname.co.uk

Then the contents of the tmp file can be viewed:

cat /tmp/zone.domainname.co.uk

To make this a bit easier I added the following to /root/.bash_profile

myshowzone()
{
echo ${1?Error domain name is not defined e.g. showzone domain.org.uk }
/usr/sbin/named-compilezone -f raw -F text -o /tmp/myzone $1 /var/named/data/zone.$1
cat /tmp/myzone
rm -rf /tmp/myzone
}
alias showzone=myshowzone
echo “To view zone data run: showzone domain.com”

 

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>