rndc:错误:/etc/bind/rndc.key:5:未知选项'options'..无法加载rndc配置

时间:2014-01-04 15:33:42

标签: linux dns ubuntu-12.04 bind

我正在研究我的Bsc论文,该论文讨论了基于DNS的命名实体认证(DANE)。为了设置DANE记录,我首先需要建立一个简单的BIND服务器(后来安装DNSSEC .. )。我是Linux新手,非常感谢详细的帮助:)

我在Ubuntu 12.04上安装了BIND9。配置" named.conf.options"," named.conf.local"和" rndc.key"。但是,当我尝试重新启动bind时(使用命令:/etc/init.d/bind9 restart),我收到以下错误:

  root@ubuntu:/etc/bind# /etc/init.d/bind9 restart
     * Stopping domain name service... bind9                                                                                                       
rndc: error: /etc/bind/rndc.key:5: unknown option 'options'
    rndc: could not load rndc configuration
                                                                                                                             [ OK ]
     * Starting domain name service... bind9                                                                                       [fail] 
    root@ubuntu:

我也遵循了本教程(http://ubuntuforums.org/showthread.php?t=1543750),并且命令:tail /var/log/daemon | grep named用于分析日志,对我来说不起作用!

这是我的named.conf文件:

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/rndc.key";
key "rndc-key" {
       algorithm hmac-md5;
       secret "2mPij4Zk4JSh0KKUZPPEgA==";
};
controls {
       inet 127.0.0.1 port 953
       allow { 127.0.0.1; } keys { "rndc-key"; };
};

这是我的rndc.key文件:

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

这是我的区域设置:

$ORIGIN .
$TTL 86400 ; 1 day

danetest.com. IN SOA srv1.danetest.com. hostmaster.danetest.com. (
        2014010307 ; serial
        8H ; refresh
        4H ; retry;
        25W ; expire
        1D ; minimum
)

danetest.com. IN NS srv1.danetest.com.

$ORIGIN danetest.com.

localhost IN A 127.0.0.1

daneverified IN A 192.168.1.101
danebroken   IN A 192.168.1.101

非常感谢您的帮助!谢谢! :)

1 个答案:

答案 0 :(得分:1)

除了密钥之外,

rndc.key不应包含任何内容。然后,您可以在/etc/bind/rndc.conf中为rndc以及/etc/bind/named.conf中的某个地方或其中包含此内容。我有一个工作配置,在https://github.com/chicks-net/dns-cache-performance/tree/master/configs/bind进行了一些操作。有一个Makefile用于生成rndc.key,但您必须手动清理'伪造'选项。