BIND9上的二进制区文件

DNS主区域文件已被传输到从属,但无法读取区域文件:

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

这发生在我使用这个命令之后:

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

我安装了绑定V.9.9而不是V.9.6。 我希望能够以纯文本的forms阅读区域文件。

BIND 9.9中的从属区域数据文件默认为“原始”格式。 您可以使用BIND附带的named-compilezone实用程序将“原始”格式的区域文件转换为“文本”格式。

原始文本:

 # 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 

文字到原始:

 # 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 

或者只是编辑你的named.conf并使用这个选项:

 Masterfile-Format Text; 

您可以在每个区域选项中执行相同的操作。