DNS服务 /etc/rndc.key was found 解决办法

RHEL6配置好dns服务之后,会出现如下问题,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包含在里面的。所以我们http://www.linuxidc.com要手动创建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:                                            [  OK  ]

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

[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

转载于:https://www.cnblogs.com/Smile2019/archive/2012/10/03/2710904.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值