This site is for tech Q&A. Please keep your posts focused on the subject at hand.

Ask one question at a time. Don't conflate multiple problems into a single question.

Make sure to include all relevant information in your posts. Try to avoid linking to external sites.

Links to documentation are fine, but in addition you should also quote the relevant parts in your posts.

0 votes

I'm running BIND as a DNS slave and want to check if the zone contains the correct records after an update on the master. However, the zone file appears to be binary:

root@server:/var/lib/bind/zones# file data
root@server:/var/lib/bind/zones# hexdump -C
00000000  00 00 00 02 00 00 00 01  5f bc cb d0 00 00 00 00  |........_.......|
00000010  00 00 00 00 00 00 00 00  00 00 00 72 00 01 00 06  |...........r....|

Is there a way to check this file for the presence (or absence) of particular records?

in General by (330) 2 9
edited by

Your answer


Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
By submitting this post you agree to our Terms & Conditions.
To avoid this verification in future, please log in or register.

1 Answer

0 votes

BIND comes with a tool named-compilezone that allows you to convert a zone file from binary to text and vice versa.


To convert a zonefile from binary to text use raw as the input format and text as the output format. If you want the output on STDOUT instead of a file use - as the output file name. Add the option -q to suppress status output.

Something like this:

named-compilezone -q -f raw -F text -o - /var/lib/bind/zones/

should produce output like this:      300 IN SOA 2020112400 10800 3600 604800 3600      300 IN NS      300 IN NS  300 IN A

You can then process the output with the usual text tools (grep, sed, awk, perl, ...). The presence of a particular A record could for instance be verified like this:

... | grep "^foo\.example\.org.* IN A"
by (330) 2 9