Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Binary Zone File Problem (FREEBSD)

DNS Master transfered zone file to slave But I cannot read zone file

less db.example.com

"db.example.com "may be a binary file. See it anyway?

This happend after I use this command:

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

I install bind V.9.9 instead of V.9.6. I would like to read zone file which not binary file. What i should to do?

Thank you in advance.

share|improve this question
4  
Why did you cp -r /usr/local/sbin/* /usr/sbin/.??? –  slimsuperhero 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

1 Answer 1

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 "example.net.raw", containing data for zone example.net,
# to text-format zone file "example.net.text"
#
#   (command)     (format options)   (output file)  (zone origin) (input file)
named-compilezone -f raw -F text -o example.net.text example.net example.net.raw

text to raw:

# convert text format zone file "example.net.text", containing data for zone
# example.net, to raw zone file "example.net.raw"
#
#   (command)     (format options)   (output file) (zone origin)  (input file)
named-compilezone -f text -F raw -o example.net.raw example.net example.net.text
share|improve this answer
    
Thank you. There are 2 files. 1st file is db-HdPKbJ2m(original not binary) and db.example.com(binary) and i used command like this: named-compilezone -f raw -F text -o db.example.com db-HdPKbJ2m db.example.com But This error has been happened. dns_master_load: example.com: not at top of zone dns_master_load: not at top of zone zone db-HdPKbJ2m/IN: loading from master file db.example.com 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

Your Answer

 
discard

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.