绑定在Windows Server 2k8上; rndc重新加载失败,原因不明

我试图在Windows Server 2008上安装绑定9.9,但调用“rndc reload”失败,出现一个非常奇怪的错误信息:

PS C:\bind\etc> ..\bin\rndc.exe reload rndc: error: C:\bind\etc\rndc.conf:1: unknown option ' ■#...' rndc: error: C:\bind\etc\rndc.conf:5: unknown option '' rndc: error: C:\bind\etc\rndc.conf:11: unknown option '' rndc: error: C:\bind\etc\rndc.conf:13: unexpected token near end of file rndc: could not load rndc configuration 

这里是rndc.conf的内容。 我用Notepad ++打开了这个文件,并确认没有非打印字符,并且行尾看起来很好(正常的Windows行结束符):

 # Start of rndc.conf key "rndc-key" { algorithm hmac-md5; secret "vP+yTbzcnlq90UFC4GuNCg=="; }; options { default-key "rndc-key"; default-server 127.0.0.1; default-port 953; }; # End of rndc.conf 

以下是named.conf的内容:

 # Use with the following in named.conf, adjusting the allow list as needed: key "rndc-key" { algorithm hmac-md5; secret "vP+yTbzcnlq90UFC4GuNCg=="; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; }; # End of named.conf 

对于什么是值得的,我已经得到绑定和rndc在Windows 7上正常工作,遵循相同的安装过程。 任何想法是怎么回事?

看起来您在configuration文件的开始处获得了UTF-8 BOM 。 使用另一个编辑器(或记事本++中的编辑器设置 ),它不会添加物料清单(您可以将其删除)。

检查你的字符编码; 确保它至less设置为ANSI。