问题:
BIND启动的时候出现rndc:connectfailed:connectionrefused错误
#servicenamedrestart
停止named:
启动named:[确定]
或者是下面的错误:
#rndcstatus
rndc:connectfailed:connectionrefused
分析办法(两个):
1)用下面命令查看日志,根据日志查找原因,了解配置文件加载成功与否!
#more/var/log/messages|grepnamed
日志如下:
[root@linuxservernamed]#more/var/log/messages|grepnamed
Mar2716:26:30linuxservernamed[2220]:shuttingdown:flushingchanges
Mar2716:26:30linuxservernamed[2220]:stoppingcommandchannelon127.0.0.1#953
Mar2716:26:30linuxservernamed[2220]:nolongerlisteningon127.0.0.1#53
Mar2716:26:30linuxservernamed[2220]:nolongerlisteningon192.168.1.40#53
Mar2716:26:30linuxservernamed[2220]:exiting
Mar2716:26:30linuxservernamed:succeeded
Mar2716:26:33linuxservernamed[4877]:startingBIND9.2.4-unamed-t/var/named/chroot
Mar2716:26:33linuxservernamed:named启动succeeded
Mar2716:26:33linuxservernamed[4877]:using1CPU
Mar2716:26:33linuxservernamed[4877]:loadingconfigurationfrom/etc/named.conf
Mar2716:26:33linuxservernamed[4877]:listeningonIPv4interfacelo,127.0.0.1#53
Mar2716:26:33linuxservernamed[4877]:listeningonIPv4interfaceeth0,192.168.1.40#53
Mar2716:26:33linuxservernamed[4877]:commandchannellisteningon127.0.0.1#953
Mar2716:26:33linuxservernamed[4877]:zone0.in-addr.arpa/IN:loadedserial42
Mar2716:26:33linuxservernamed[4877]:zone0.0.127.in-addr.arpa/IN:loadedserial1997022700
Mar2716:26:33linuxservernamed[4877]:zone1.168.192.in-addr.arpa/IN:loadedserial2007031700
Mar2716:26:33linuxservernamed[4877]:zone255.in-addr.arpa/IN:loadedserial42
Mar2716:26:33linuxservernamed[4877]:zone0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN:loadedserial1997022700
Mar2716:26:33linuxservernamed[4877]:talented.com.cn.dns:10:filedoesnotendwithnewline
Mar2716:26:33linuxservernamed[4877]:zonetalented.com.cn/IN:loadedserial2007031700
Mar2716:26:33linuxservernamed[4877]:zoneqfmy.tyut.edu.cn/IN:loadedserial2007031700
Mar2716:26:33linuxservernamed[4877]:texsx.com.dns:10:filedoesnotendwithnewline
Mar2716:26:33linuxservernamed[4877]:zonetexsx.com/IN:loadedserial2007031700
Mar2716:26:33linuxservernamed[4877]:zonelocaldomain/IN:loadedserial42
Mar2716:26:33linuxservernamed[4877]:zonelocalhost/IN:loadedserial42
Mar2716:26:33linuxservernamed[4877]:running
2)用命令查看rndcstatus
[root@linuxservernamed]#rndcstatus
numberofzones:12
debuglevel:0
xfersrunning:0
xfersdeferred:0
soaqueriesinprogress:0
queryloggingisOFF
serverisupandrunning
若出现上面的状态serverisupandrunning说明启动成功!