DNS服務 /etc/rndc.key was found 解決辦法

RHEL6配置好dns服務以後,會出現以下問題,rndc沒法找到key,named服務跑的是正常的,其實本也能夠用,可是本着不能放過一個問題的原則,找到了解決辦法 linux

[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 dom

提示沒有rndc.key,主要緣由仍是在RHEL6上沒有caching-named這個包了,EL5上是把key包含在裏面的。因此咱們http://www.linuxidc.com要手動建立key tcp

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 spa

[root@server named]# cat /etc/rndc.key 
key "rndc-key" {
    algorithm hmac-md5;
    secret "MEARtiTMJzFfRwBKlY5lpQ==";
}; .net

[root@server named]# ls -l /etc/rndc.key 
-rw------- 1 root root 77 May  1 06:57 /etc/rndc.key debug

[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 rest

重啓named服務!
3)驗證
[root@server named]# /etc/init.d/named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ] server

[root@server named]# /etc/init.d/named status
version: 9.7.3-P3-RedHat-9.7.3-8.P3.el6
CPUs found: 1
worker threads: 1
number of zones: 21
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  4224) is running... dns

[root@server named]# rndc status
version: 9.7.3-P3-RedHat-9.7.3-8.P3.el6
CPUs found: 1
worker threads: 1
number of zones: 21
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 md5

相關文章
相關標籤/搜索