由 lxmaming 在 08-18-2004 21:13 发表:
大家最常见的dns rndc错误 ! [rndc讨论]
[root@Vivian /]# etc/rc.d/init.d/named restart
Stopping named: rndc: connect failed: connection refused [FAILED]
Starting named: [FAILED]
由 Snoopy 在 08-19-2004 01:50 发表:
你如何配置的,之前是否能使用过 ? 日志如何说 ?
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 Snoopy 在 08-19-2004 01:54 发表:
rndc-confgen里面如何说 ?
将防火墙关掉看看,跟防火墙有关系
我的没问题
root: /snoopy/test/c # service named start
Starting named: [ OK ]
root: /snoopy/test/c # rndc status
number of zones: 6
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
server is up and running
root: /snoopy/test/c #
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 Snoopy 在 08-19-2004 02:12 发表:
制造这样的错误出来
root: /snoopy/test/c # iptables -A OUTPUT -p tcp --dport 953 -j DROP
root: /snoopy/test/c # service named stop
Stopping named: rndc: connect failed: operation canceled
[ OK ]
root: /snoopy/test/c #
问题的关键在与rndc.conf中的这一行:
default-server localhost;
如果将”localhost”改为”localhost.”或者127.0.0.1,可以解决这个问题.
查看rndc的参数,有一个-s选项,可以指定需要控制的服务器,下面这个命令也可以:
rndc -s 127.0.0.1 reload 或 rndc -s localhost. reload
再从日志中分析,启动bind 9时日志如下:
May 8 snoopy named[513]: starting BIND 9.2.2
May 8 snoopy named[513]: command channel listening on 127.0.0.1#953
可以看出,bind 9在127.0.0.1上监听953端口响应命令行通道.对应named.conf中的配置,在controls语句中,127.0.0.1用来指定本机那个接口地址来监听命令行通道,allow指定那些地址可以进行远程控制(例子中仅允许localhost).可以设想,如果将inet配置为本机上一个实际的网络接口地址,allow中不但允许localhost,并且允许其他IP(譬如管理员的机器地址),那么就可以通过这些地址来”远程”控制named的动作.
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
这也是为什么bind 9把原来的ndc改为rndc的原因:remote ndc.
另外,bind 9打开的TCP端口953,用来响应rndc的控制信号(本地或远程),当bind 9关闭后,这个端口也关闭,这也是为什么rndc中取消start参数的原因:如果未启动bind 9,系统也没有在953端口监听,就谈不上远程控制了.
再回到上面的问题,为什么default-server设置为localhost则rndc返回网络不可达?而对”127.0.0.1”进行控制则可以,”localhost.”也可以.
这说明,rndc并没有承认/etc/hosts文件中localhost和127.0.0.1的对应关系,当对命令行通道试图连接localhost的953端口时,发现并不能对localhost进行解析,因为不知道其IP地址,所以报告网络不可达.这样也就不能连接到127.0.0.1的953端口对named进行控制.
这样种种的原因你参考一下,我都没碰过,,
参考文章
http://chinaunix.net/jh/16/241321.html
还有一种可能是953端口被占用了,
通常我们是通过 unix 系统的中断信号来控制 named 进程,如使用
-HUP 来使 named 重新读入配置文件的信息等等。而 rndc 是
bind 软件引进的远程控制通道,代替 unix 信号来控制 named
进程。使用 rndc 你就可以使用 rndc reload 等命令来重新读入
named.conf 配置文件了
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from