在ubuntu7.04下DNS的问题

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
烟雨平生
帖子: 103
注册时间: 2006-07-06 16:35
送出感谢: 0
接收感谢: 0
联系:

在ubuntu7.04下DNS的问题

#1

帖子 烟雨平生 » 2008-06-30 16:53

已经安装了必须的软件了:

allinster@allinster-desktop:~$ dpkg -l bind9
期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
| 当前状态=未(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)
|/ 错误?=(无)/保持(?)/须重装(R)/两者兼有(#) (状态,错误:大写=故障)
||/ 名称 版本 简介
+++-==============-==============-============================================
ii bind9 9.3.4-2ubuntu2 Internet Domain Name Server
[allinster@allinster-desktop:~$ dpkg -l|grep bind9
ii bind9 9.3.4-2ubuntu2.2 Internet Domain Name Server
ii bind9-host 9.3.4-2ubuntu2.2 Version of 'host' bundled with BIND 9.X
ii libbind9-0 9.3.4-2ubuntu2.2 BIND9 Shared Library used by BIND
allinster@allinster-desktop:~$ dpkg -l bind9 bind9-host libbind9-0
期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
| 当前状态=未(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)
|/ 错误?=(无)/保持(?)/须重装(R)/两者兼有(#) (状态,错误:大写=故障)
||/ 名称 版本 简介
+++-==============-==============-============================================
ii bind9 9.3.4-2ubuntu2 Internet Domain Name Server
ii bind9-host 9.3.4-2ubuntu2 Version of 'host' bundled with BIND 9.X
ii libbind9-0 9.3.4-2ubuntu2 BIND9 Shared Library used by BIND


/etc/bind/named.conf文件为:
allinster@allinster-desktop:~$ cat /etc/bind/named.conf
include "/etc/bind/named.conf.options";
zone "." {
type hint;
file "/etc/bind/db.root";
};

zone "localhost" {
type master;
file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};


zone "allinster.com" IN {
type master;
file "allinster.zone";
};

zone "55.168.192.in-addr.arpa" IN {
type master;
file "allinster.arpa";
};

include "/etc/bind/named.conf.local";


/etc/bind/allinster.zone 文件为:
$TTL 86400
55.168.192.in-addr.arpa. IN SOA dns.allinster.com. allinster.localhost (
200820
10800
2400
3600
86400 )

55.168.192.in-addr.arpa. IN NS dns.allinster.com.
103.1.168.192.in-addr.arpa. IN PTR dns.allinster.com.
80.55.168.192.in-addr.arpa. IN PTR www.allinster.com.
21.55.168.192.in-addr.arpa. IN PTR ftp.allinster.com.
25.55.168.192.in-addr.arpa. IN PTR mail.allinster.com.
55.55.168.192.in-addr.arpa. IN PTR bbs.allinster.com.


/etc/bind/allinster.arpa文件为:
$TTL 86400
55.168.192.in-addr.arpa. IN SOA dns.allinster.com. allinster.localhost (
200820
10800
2400
3600
86400 )

55.168.192.in-addr.arpa. IN NS dns.allinster.com.
103.1.168.192.in-addr.arpa. IN PTR dns.allinster.com.
80.55.168.192.in-addr.arpa. IN PTR www.allinster.com.
21.55.168.192.in-addr.arpa. IN PTR ftp.allinster.com.
25.55.168.192.in-addr.arpa. IN PTR mail.allinster.com.
55.55.168.192.in-addr.arpa. IN PTR bbs.allinster.com.



检测各个配置文件:
allinster@allinster-desktop:/etc/bind$ sudo named-checkzone allinster.com allinster.zone
zone allinster.com/IN: loaded serial 200820
OK

allinster@allinster-desktop:/etc/bind$ echo $?
0
allinster@allinster-desktop:/etc/bind$ sudo named-checkzone 55.168.192.in-addr.arpa allinster.arpa [/color=blue]
allinster.arpa:10: ignoring out-of-zone data (103.1.168.192.in-addr.arpa)
zone 55.168.192.in-addr.arpa/IN: loaded serial 200820
OK[/color]
allinster@allinster-desktop:/etc/bind$ echo $?
0


本机IP为:192.168.1.103

/etc/resolv.conf文件为:
allinster@allinster-desktop:/etc/bind$ cat /etc/resolv.conf
search domain
nameserver 192.168.1.103
nameserver 202.203.132.1
nameserver 202.203.132.100


启动DNS服务:
allinster@allinster-desktop:/etc/bind$ sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind [ OK ]
* Starting domain name service... bind [ OK ]
allinster@allinster-desktop:/etc/bind$ echo $?
0

测试:
allinster@allinster-desktop:/etc/bind$ nslookup
> www.allinster.com
Server: 192.168.1.103
Address: 192.168.1.103#53

** server can't find www.allinster.com: SERVFAIL
> ftp.allinster.com
Server: 192.168.1.103
Address: 192.168.1.103#53

** server can't find ftp.allinster.com: SERVFAIL


怎么不对呢?请知道的朋友解答一二,谢过了!

补充:这样的配置在Debian(Etch)上运行完全正常
leafei
帖子: 83
注册时间: 2008-06-29 21:41
送出感谢: 0
接收感谢: 0

Re: 在ubuntu7.04下DNS的问题

#2

帖子 leafei » 2008-06-30 22:02

烟雨平生 写了: zone "allinster.com" IN {
type master;
file "allinster.zone";
};
乍一看是这个地方出了问题: 你的"allinster.zone"文件的zone应该为:"." OR "allinster.com." OR 空格,而不是如下的"55.168.192.in-addr.arpa.".
烟雨平生 写了:/etc/bind/allinster.zone 文件为:
$TTL 86400
55.168.192.in-addr.arpa. IN SOA dns.allinster.com. allinster.localhost (
200820
10800
2400
3600
86400 )

55.168.192.in-addr.arpa. IN NS dns.allinster.com.
103.1.168.192.in-addr.arpa. IN PTR dns.allinster.com.
80.55.168.192.in-addr.arpa. IN PTR www.allinster.com.
21.55.168.192.in-addr.arpa. IN PTR ftp.allinster.com.
25.55.168.192.in-addr.arpa. IN PTR mail.allinster.com.
55.55.168.192.in-addr.arpa. IN PTR bbs.allinster.com.


/etc/bind/allinster.arpa文件为:
$TTL 86400
55.168.192.in-addr.arpa. IN SOA dns.allinster.com. allinster.localhost (
200820
10800
2400
3600
86400 )

55.168.192.in-addr.arpa. IN NS dns.allinster.com.
103.1.168.192.in-addr.arpa. IN PTR dns.allinster.com.
80.55.168.192.in-addr.arpa. IN PTR www.allinster.com.
21.55.168.192.in-addr.arpa. IN PTR ftp.allinster.com.
25.55.168.192.in-addr.arpa. IN PTR mail.allinster.com.
55.55.168.192.in-addr.arpa. IN PTR bbs.allinster.com.



检测各个配置文件:
allinster@allinster-desktop:/etc/bind$ sudo named-checkzone allinster.com allinster.zone
zone allinster.com/IN: loaded serial 200820
OK
这个地方的serial number应该是你reverse zone的serial. 成功。但你的forward zone跟reverse zone是同一个serial, 所以不太好判断。其实tail -f /var/log/message可能会更直接一点。
烟雨平生 写了:allinster@allinster-desktop:/etc/bind$ echo $?
0
allinster@allinster-desktop:/etc/bind$ sudo named-checkzone 55.168.192.in-addr.arpa allinster.arpa [/color=blue]
allinster.arpa:10: ignoring out-of-zone data (103.1.168.192.in-addr.arpa)
zone 55.168.192.in-addr.arpa/IN: loaded serial 200820
OK[/color]
allinster@allinster-desktop:/etc/bind$ echo $?
0


本机IP为:192.168.1.103

/etc/resolv.conf文件为:
allinster@allinster-desktop:/etc/bind$ cat /etc/resolv.conf
search domain
nameserver 192.168.1.103
nameserver 202.203.132.1
nameserver 202.203.132.100



启动DNS服务:
allinster@allinster-desktop:/etc/bind$ sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind [ OK ]
* Starting domain name service... bind [ OK ]
allinster@allinster-desktop:/etc/bind$ echo $?
0

测试:
allinster@allinster-desktop:/etc/bind$ nslookup
> www.allinster.com
Server: 192.168.1.103
Address: 192.168.1.103#53

** server can't find www.allinster.com: SERVFAIL
> ftp.allinster.com
Server: 192.168.1.103
Address: 192.168.1.103#53

** server can't find ftp.allinster.com: SERVFAIL


怎么不对呢?请知道的朋友解答一二,谢过了!


补充:这样的配置在Debian(Etch)上运行完全正常

不知道对你有没有帮助呢?:)
头像
烟雨平生
帖子: 103
注册时间: 2006-07-06 16:35
送出感谢: 0
接收感谢: 0
联系:

#3

帖子 烟雨平生 » 2008-07-05 8:53

多谢leafei,不过我这个配置在debian 和fedora8上都很正常。

等我再研究研究吧。
albumbbb
帖子: 20
注册时间: 2008-05-17 10:30
送出感谢: 0
接收感谢: 0

Re: 在ubuntu7.04下DNS的问题

#4

帖子 albumbbb » 2009-06-24 15:19

我在8.04里也有同样的问题,不知道大哥怎么解决的,分享一下,谢谢!
Perfect!!!
回复

回到 “服务器基础应用”