redhat中用BIND配置DNS不能成功解析
我是采用9自带的,进行有关文件设置好以后,用nslookup验证,出现如下错误提示:connection timed out;no servers could be reached.请问这是什么原因造成的呢,该如何解决,谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
用host www.abc.com出现如下提示:host www.abc.com not found.(2 servfail),请高手帮忙解答,谢谢
把你具体怎么配置的步骤拿出来看看,再看一下你的/var/log/messanges日志
/etc/named.conf配置如下:
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 172.16.1.200 allow { gzbenet.cn; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "gznet.cn" IN {
type master;
file "named.gznet.cn";
allow-update {none; };
};
zone "1.16.172.in-addr.arpa" IN {
type master;
file "named.1.16.172";
allow-update {none; };
};
include "/etc/rndc.key";
/var/named/named.gznet.cn配置如下:
$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
45 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS vmlinux.gzbenet.cn.
localhost 1D IN A 127.0.0.1
vmlinux IN A 172.16.1.200
mail IN MX 5 172.16.1.200
vmlinux2 IN A 172.16.1.201
www IN CNAME vmlinux
/var/named/named.1.16.172配置如下:
$TTL 86400
@ IN SOA localhost. root.localhost. (
2005010101 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
200 IN PTR vmlinux.gzbenet.cn.
201 IN PTR vmlinux2.gzbenet.cn.
/var/log/messages有关如下:
un 21 15:20:52 vmlinux 6月 21 15:20:52 smb: nmbd shutdown succeeded
Jun 21 15:20:52 vmlinux 6月 21 15:20:52 smb: smbd startup succeeded
Jun 21 15:20:53 vmlinux 6月 21 15:20:52 smb: nmbd startup succeeded
Jun 21 15:20:58 vmlinux samba(pam_unix)[2527]: session opened for user root by (uid=0)
Jun 21 15:25:07 vmlinux samba(pam_unix)[2527]: session closed for user root
Jun 21 15:25:08 vmlinux 6月 21 15:25:08 smb: smbd shutdown succeeded
Jun 21 15:25:08 vmlinux 6月 21 15:25:08 smb: nmbd shutdown succeeded
Jun 21 15:25:08 vmlinux 6月 21 15:25:08 smb: smbd startup succeeded
Jun 21 15:25:08 vmlinux 6月 21 15:25:08 smb: nmbd startup succeeded
Jun 21 15:25:13 vmlinux samba(pam_unix)[2560]: session opened for user root by (uid=0)
请高手帮忙看下,谢谢
/var/log/messages中相关内容如下:Jun 21 15:47:27 vmlinux named[2590]: loading configuration from '/etc/named.conf'
Jun 21 15:47:27 vmlinux named[2590]: no IPv6 interfaces found
Jun 21 15:47:27 vmlinux named[2590]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 21 15:47:27 vmlinux named[2590]: binding TCP socket: address in use
Jun 21 15:47:27 vmlinux named[2590]: listening on IPv4 interface eth0, 172.16.1.200#53
Jun 21 15:47:27 vmlinux named[2590]: binding TCP socket: address in use
Jun 21 15:47:27 vmlinux named[2590]: /etc/named.conf:19: undefined ACL 'gzbenet.cn'
Jun 21 15:47:27 vmlinux named[2590]: /etc/named.conf:19: couldn't add command channel 172.16.1.200#953: not found
Jun 21 15:47:27 vmlinux named[2590]: couldn't open pid file '/var/run/named/named.pid': File exists
Jun 21 15:47:27 vmlinux named[2590]: exiting (due to early fatal error)
我觉得你这个文件:named.gznet.cn 放的位置不对,如果是系统自带得话,你看/etc/init.d/named这个文件执行的时候是这样:/usr/sbin/named -u named -t /var/named -c /etc/named.conf
请注意:-t 这个参数,它实际上是说 chroot的位置,所以你不能把named.gznet.cn这个文件放在跟目录下/var/named这个目录里,完整的路径应该是这样/var/named/chroot/var/named/named.gznet.cn 如若你非放在根目录/var/named这个目录里,你要ln -s named.gznet.cn chroot/var/named/named.gznet.cn ,这样应该没什么问题,它本身自带那些配置脚本也是从/var/named/chroot/var/named/下连接到/var/named/下的。named.1.16.172这个文件也如此。
named.gznet.cn第三行定应该有问题。一是那一行有问题。二是符号key错
谢谢,但是我在/var/named下面找不到chroot这个目录啊,能够继续指点下吗?
干脆,我把我的DNS的简单配置发给你,你看看,希望能给于你一些帮助。
我自己编译安装的,不是系统自带的。
/etc/named.conf
options {
directory "/var/named";
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "omms.cnc" IN {
type master;
file "omms.cnc.zone";
allow-update { none; };
};
zone "22.12.10.in-addr.arpa" IN {
type master;
file "omms.cnc.rev";
allow-update { none; };
};
include "/etc/rndc.key";
/etc/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "HW1jQFJtWK1hye2v0Yt59A==";
};
/var/named/omms.cnc.zone
$TTL 86400
@ IN SOA omms-develop.omms.cnc. root.omms.cnc. (
2004041900 ;Serial
28800 ;Refresh
14400 ;Retry
3600000 ;Expire
86400 ) ;Minimum
IN NS omms-develop.omms.cnc.
IN MX 10 mail.omms.cnc.
omms-develop.omms.cnc. IN A 10.12.22.23
www.omms.cnc. IN A 10.12.22.23
ftp.omms.cnc. IN A 10.12.22.23
omms.cnc. IN A 10.12.22.23
jserv.omms.cnc. IN A 10.12.22.23
appserv.omms.cnc. IN A 10.12.22.23
webserv.omms.cnc. IN A 10.12.22.23
mail.omms.cnc. IN A 10.12.22.28
pop3.omms.cnc. IN A 10.12.22.28
smtp.omms.cnc. IN A 10.12.22.28
/var/named/omms.cnc.rev
$TTL 86400
@ IN SOA omms-develop.omms.cnc. root.omms.cnc. (
2004041900 ;Serial
28800 ;Refresh
14400 ;Retry
3600000 ;Expire
86400 ) ;Minimum
IN NS omms-develop.omms.cnc.
23 IN PTR omms-develop.omms.cnc.
23 IN PTR www.omms.cnc.
23 IN PTR ftp.omms.cnc.
23 IN PTR jserv.omms.cnc.
23 IN PTR appserv.omms.cnc.
23 IN PTR webserv.omms.cnc.
28 IN PTR mail.omms.cnc.
28 IN PTR pop3.omms.cnc.
28 IN PTR smtp.omms.cnc.
还有那个localhost.zone,named.local,named.ca等就不用我说了吧,这样配置完直接执行named就行了。
非常感谢你的热情相助,但是我没有发现我的和你的配置有什么本质上的区别,还是出现同样错误,请高手继续帮忙,谢谢