LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1187|回复: 1

跪求一个Fedora8上的DNS配置问题

[复制链接]
发表于 2008-6-18 15:06:35 | 显示全部楼层 |阅读模式
操作平台:Fedora 8 i386

/var/named/chroot/etc/named.conf 文件内容为:

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//

options {
        directory         "/var/named";
        dump-file         "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
};

#controls {
#inet 127.0.0.1 allow {localhost;} keys{rndckey;};
#};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "chn.com" IN {
        type master;
        file "chn.com";
        allow-update {none;};
};

zone "4.168.192.in-addr.arpa" IN {
        type master;
        file "4.168.192.arpa";
        allow-update {none;};
};
include "/etc/named.rfc1912.zones";


/var/named/chroot/var/name/chn.com 内容为:


$TTL 3h
chn.com. IN SOA dns.chn.com. root.dns.chn.com. (
1;
3h;
1h;
1w;
1h);
chn.com. IN NS dns.chn.com.
dns.chn.com. IN A 192.168.4.22
www.chn.com.        IN A 192.168.4.251
chn.chn.com. IN A CNAME www.chn.com.


/var/named/chroot/var/name/4.168.192.arpa 文件内容为:

$TTL 3h
4.168.192.in-addr.arpa. IN SOA dns.chn.com. root.dns.chn.com. (
1;
3h;
1h;
1w;
1h);

4.168.192.in-addr.arpa IN NS dns.chn.com.
22.4.168.192.in-addr.arpa IN PTR dns.chn.com.
251.4.168.192.in-addr.arpa IN PTR www.chn.com.


/etc/init.d/named start 时出错:


[root@localhost named]# /etc/init.d/named start
启动 named:
Error in named configuration:
zone chn.com/IN: loaded serial 1
zone 4.168.192.in-addr.arpa/IN: has no NS records
_default/4.168.192.in-addr.arpa/IN: bad zone
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.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.0.ip6.arp a/IN: NS '1.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.0.ip 6.arpa' has no address records (A or AAAA)
zone 1.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.0.ip6.arp a/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: NS '1.0.0.127.in-addr.arpa' has no address r ecords (A or AAAA)
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: NS '0.in-addr.arpa' has no address records (A or AAA A)
zone 0.in-addr.arpa/IN: loaded serial 0
                                                           [失败]


看了好多书,说的都是这么简单,一操作就不对了,究竟是怎么回事呀,人都快疯掉了。

请懂得DNS配置的朋友给个解释,感激不尽。
 楼主| 发表于 2008-6-19 15:29:44 | 显示全部楼层
经过修改,named.conf 文件为:
[root@localhost named]# cat /etc/named.conf
options {
        directory       "/var/named";
};

controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {
        type hint;
        file "named.ca";
};


zone "test.com" IN {
type master;
file "test";
allow-update { none; };
};

zone "5.168.192.in-addr.arpa" IN {
type master;
file "arpa";
allow-update { none; };
};

include "/etc/rndc.key";



test文件为:
[root@localhost named]# cat test
$TTL 86400
test.com. IN SOA dns.test.com. amdin.test.com. (
2006061200;
10800;
3600;
604800;
38400 );

test.com. IN NS dns.test.com.

dns.test.com. IN A 192.168.5.55
www.test.com. IN A 192.168.5.80
ftp.test.com. IN A 192.168.5.21
mail.test.com. IN A 192.168.5.23


arpa文件为:
[root@localhost named]# cat arpa  
$TTL 86400
5.168.192.in-addr.arpa. IN SOA dns.test.com. admin.test.com. (
2008061000;
10800;
3600;
604800;
38400 );

5.168.192.in-addr.arpa. IN NS dns.test.com.
55.5.168.192.in-addr.arpa. IN PTR dns.test.com.
80 IN PTR www.test.com.
21 IN PTR ftp.test.com.
23 IN PTR mail.test.com.  




但是检测时出现:
[root@localhost named]# named-checkconf /etc/named.conf
[root@localhost named]# named-checkconf test
test:1: unknown option '$TTL'
test:4: unknown option '10800'
test:5: unknown option '3600'
test:6: unknown option '604800'
test:7: unknown option '38400'
test:9: unknown option 'test.com.'
test:15: unexpected token near end of file
[root@localhost named]# named-checkconf arpa
arpa:1: unknown option '$TTL'
arpa:4: unknown option '10800'
arpa:5: unknown option '3600'
arpa:6: unknown option '604800'
arpa:7: unknown option '38400'
arpa:9: unknown option '5.168.192.in-addr.arpa.'
arpa:14: unexpected token near end of file
[root@localhost named]#

[root@localhost named]# named-checkzone test test
test:2: ignoring out-of-zone data (test.com)
test:9: ignoring out-of-zone data (test.com)
test:11: ignoring out-of-zone data (dns.test.com)
test:12: ignoring out-of-zone data (www.test.com)
test:13: ignoring out-of-zone data (ftp.test.com)
test:14: ignoring out-of-zone data (mail.test.com)
zone test/IN: has 0 SOA records
zone test/IN: has no NS records
[root@localhost named]# named-checkzone 5.168.192.in-addr.arpa arpa
zone 5.168.192.in-addr.arpa/IN: loaded serial 2008061000
OK
[root@localhost named]#


也能启动:
[root@localhost named]# /etc/init.d/named restart
停止 named:                                               [确定]
启动 named:                                               [确定]
[root@localhost named]#


就是解析不了www.test.com 的域名

错在哪里,请知道者指点一二,多谢了!!!!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表