BIND9 上的二进制区域文件

use*_*942 10 domain-name-system bind

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

> less db.example.com

"db.example.com "may be a binary file.  See it anyway?
Run Code Online (Sandbox Code Playgroud)

这是在我使用此命令后发生的:

cp -r /usr/local/sbin/* /usr/sbin/.
Run Code Online (Sandbox Code Playgroud)

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

Mic*_*lly 26

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
Run Code Online (Sandbox Code Playgroud)

文本到原始:

# 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
Run Code Online (Sandbox Code Playgroud)


小智 10

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

Masterfile-Format Text;
Run Code Online (Sandbox Code Playgroud)

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