Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A DNS Master zone file has been transferred to a slave, but I cannot read the zone file:

> less

" "may be a binary file.  See it anyway?

This happened after I used this command:

cp -r /usr/local/sbin/* /usr/sbin/.

I installed bind V.9.9 instead of V.9.6. I would like to be able to read the zone file as plain text.

share|improve this question
Why did you cp -r /usr/local/sbin/* /usr/sbin/.??? – Gevial Mar 15 '13 at 10:09
I would say: reinstall your server and everything. The short-cut might be to just re-install "world" (or the "sbin" part) and remove all the added file from "/usr/local/sbin". – Ouki Mar 15 '13 at 11:54
Is that DNS file really a binary file (or is there some control chars that makes "less" mismatching it) ? – Ouki Mar 15 '13 at 11:55
it could be something simple, such as non-printable control characters in the file, or your zone data on the slaves might really be being stored in raw format, since you are using BIND 9.9, in which case see my answer below -- you can use named.compilezone to change from one format to another if you just want to look at the file. – Michael McNally Mar 16 '13 at 3:54

Slave zone data files in BIND 9.9 are in "raw" format by default. You can convert "raw" format zone files to "text" format using the named-compilezone utility that comes with BIND.

raw to text:

# convert raw zone file "", containing data for zone,
# to text-format zone file ""
#   (command)     (format options)   (output file)  (zone origin) (input file)
named-compilezone -f raw -F text -o

text to raw:

# convert text format zone file "", containing data for zone
#, to raw zone file ""
#   (command)     (format options)   (output file) (zone origin)  (input file)
named-compilezone -f text -F raw -o
share|improve this answer
Thank you. There are 2 files. 1st file is db-HdPKbJ2m(original not binary) and and i used command like this: named-compilezone -f raw -F text -o db-HdPKbJ2m But This error has been happened. dns_master_load: not at top of zone dns_master_load: not at top of zone zone db-HdPKbJ2m/IN: loading from master file failed: not at top of zone zone db-HdPKbJ2m/IN: not loaded due to errors. – user1044942 Mar 18 '13 at 2:23
It is possible something on your system corrupted the zone files in some way. My recommendation would be that if the files are not reading correctly I would stop the server on the slave, delete the corrupt zone files (or if you prefer, rename them to move them out of the way), and restart the slave server. It should retransfer the zone contents from the master. – Michael McNally Mar 19 '13 at 1:37

Or just edit your named.conf and use this Option :

Masterfile-Format Text;

you can do it same in every Zone Option.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.