关注互联网与Web前端技术,这里是我记录网上折腾与生活感悟的地方.

DA(DirectAdmin)安装后named无法启动 & /etc/rndc.key was found 的解决方法

DirectAdmin安装后named无法启动,会出现如下问题,rndc无法找到key,named服务跑的是正常的,其实本也可以用,但是本着不能放过一个问题的原则,找到了解决办法

[root@server named]# /etc/init.d/named status
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
named (pid  4086) is running...
[root@server named]# rndc status
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found

提示没有rndc.key,主要原因还是在RHEL6上没有caching-named这个包了,EL5上是把key包含在里面的。所以我们要手动创建key

1)创建key

[root@server named]# rndc-confgen -r /dev/urandom -a
wrote key file "/etc/rndc.key"

2)更改权限

[root@server named]# rndc status
rndc: connect failed: 127.0.0.1#953: connection refused
 
[root@server named]# cat /etc/rndc.key 
key "rndc-key" {
    algorithm hmac-md5;
    secret "MEARtiTMJzFfRwBKlY5lpQ==";
};
 
[root@server named]# ls -l /etc/rndc.key 
-rw------- 1 root root 77 May  1 06:57 /etc/rndc.key
 
[root@server named]# chown root:named /etc/rndc.key 
[root@server named]# chmod 644 /etc/rndc.key 
[root@server named]# rndc status
rndc: connect failed: 127.0.0.1#953: connection refused

重启named服务!

3)验证

[root@server named]# /etc/init.d/named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  faild  ]

还是失败,发现named.conf 24行报错,

编辑/etc/named.conf,找到24行,发现这里名字不对

keys { rndckey; };

修改为

keys { rndc-key; };

[root@server named]# /etc/init.d/named restart
Stopping named: . [ OK ]
Starting named: [ OK ]

[root@server ~]# /etc/init.d/named status
version: 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4
CPUs found: 1
worker threads: 1
number of zones: 19
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid  3200) is running...
[root@server named]# rndc status
version: 9.8.2rc1-RedHat-9.8.2-0.37.rc1.el6_7.4
CPUs found: 1
worker threads: 1
number of zones: 19
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

未经允许不得转载:Yusky » DA(DirectAdmin)安装后named无法启动 & /etc/rndc.key was found 的解决方法

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址