![在 Windows Server 2k8 上绑定;rndc 重新加载无故失败](https://linux22.com/image/608819/%E5%9C%A8%20Windows%20Server%202k8%20%E4%B8%8A%E7%BB%91%E5%AE%9A%EF%BC%9Brndc%20%E9%87%8D%E6%96%B0%E5%8A%A0%E8%BD%BD%E6%97%A0%E6%95%85%E5%A4%B1%E8%B4%A5.png)
我尝试在 Windows Server 2008 上安装 Bind 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
不管怎样,我按照相同的安装过程让 Bind 和 rndc 在 Windows 7 上正常工作。有什么想法吗?
答案1
看起来你有一个UTF-8 字节序在您的配置文件开头。使用不同的编辑器(或Notepad++ 中的编辑器设置) 不会添加BOM(并且您可以用它删除这一项)。
答案2
检查您的字符编码;确保它至少设置为 ANSI。