BIND9 上的二进制区域文件

BIND9 上的二进制区域文件

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

> less db.example.com

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

我使用此命令后发生了以下情况:

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

我安装了 bind V.9.9 而不是 V.9.6。我希望能够以纯文本形式读取区域文件。

答案1

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

答案2

或者只需编辑你的named.conf并使用此选项:

Masterfile-Format Text;

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

相关内容