求教:DNS配置问题。
小弟,最近在配置DNS,但是不知道错误在什么地方:配置如下,希望哪位大虾能够指教!先谢谢了。
[root@Linux etc]# more named.conf
//
// named.conf for Red Hat caching-nameserver
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* 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;
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "mycompany.com" IN {
type master;
file "name2ip.conf";
allow-update { none; };
};
zone "150.18.172.in-addr.arpa" IN {
type master;
file "ip2name.conf";
allow-update { none; };
};
include "/etc/rndc.key";
[root@Linux named]# more name2ip.conf
$TTL 86400
@ IN SOA Linux.mycompany.com. root.Linux.mycompany.com.
(
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS Linux.mycompany.com.
IN MX 10 Linux.mycompany.com.
localhost IN A 127.0.0.1
Linux IN A 172.18.150.250
L3 IN A 172.18.150.137
www CNAME L3
mail CNAME L3
[root@Linux named]# more ip2name.conf
$TTL 86400
@ IN SOA Linux.mycompany.com. root.Linux.mycompany.com.(
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS Linux.mycompany.com.
IN MX 10 Linux.mycompany.com.
137 IN PTR L3.mycompany.com.
250 IN PTR Linux.mycompany.com.
[root@Linux named]# more named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
[root@Linux named]# more /etc/resolv.conf
nameserver 172.18.150.250
nameserver 202.102.24.35
nameserver 211.98.4.1
search mycompany.com
[ 本帖最后由 ngcisco 于 2006-9-21 08:26 编辑 ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
按照cyrus1006所说进行named-checkzone检测。有如下错误。
[root@Linux named]# /usr/sbin/named-checkzone 150.18.172.in-addr.arpa ip2name.conf
dns_master_load: ip2name.conf:11: unknown RR type 'PTR L3.mycompany.com.'
zone 150.18.172.in-addr.arpa/IN: loading master file ip2name.conf: unknown class/type
[root@Linux named]# /usr/sbin/named-checkzone mycompany.com name2ip.conf
dns_rdata_fromtext: name2ip.conf:2: near eol: unexpected end of input
dns_master_load: name2ip.conf:3: unknown RR type '3H'
zone mycompany.com/IN: loading master file name2ip.conf: unexpected end of input
看来楼主对DNS的ZONE和ARPA的配置文件的语法不是了解,建议楼主还是找点资料看看,先了解一下吧……
感谢大家支持!确实是bind版本是9.2.4 。我把name2ip.conf 和ip2name.conf拷贝到/var/named/chroot/var/named下,上面的问题就解决了。但是又出现了新的问题。我在nslookup测试时还时失败还有这样的报错,感谢大家帮我分析分析。谢谢了。
Sep 21 08:20:27 Linux named[29276]: starting BIND 9.2.4 -u named -t /var/named/chroot
Sep 21 08:20:27 Linux named[29276]: using 1 CPU
Sep 21 08:20:27 Linux named: named 启动 succeeded
Sep 21 08:20:27 Linux named[29276]: loading configuration from '/etc/named.conf'
Sep 21 08:20:27 Linux named[29276]: listening on IPv4 interface lo, 127.0.0.1#53
Sep 21 08:20:27 Linux named[29276]: listening on IPv4 interface eth0, 172.18.150.250#53
Sep 21 08:20:27 Linux named[29276]: command channel listening on 127.0.0.1#953
Sep 21 08:20:27 Linux named[29276]: command channel listening on ::1#953
Sep 21 08:20:27 Linux named[29276]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Sep 21 08:20:27 Linux named[29276]: dns_master_load: ip2name.conf:11: unknown RR type 'PTR L3.mycompany.com.'
Sep 21 08:20:27 Linux named[29276]: zone 150.18.172.in-addr.arpa/IN: loading master file ip2name.conf: unknown class/type
Sep 21 08:20:27 Linux named[29276]: dns_rdata_fromtext: name2ip.conf:2: near eol: unexpected end of input
Sep 21 08:20:27 Linux named[29276]: zone mycompany.com/IN: loading master file name2ip.conf: unexpected end of input
Sep 21 08:20:27 Linux named[29276]: running
建议楼主在启动服务之前使用
named-checkzone命令先检查一下ip2name.conf和name2ip.conf文件
还有在/etc/sysconfig/named文件中是否有ROOTDIR=/var/named/chroot
如果有,zone文件必须放在/var/named/chroot/var/named目录下
命令rndc reload试一下
你使用的应该是bind9 的新版本,注意是否使用了chroot 这样目录就有变化了
留个名
关注下
named服务可以正常启动。但是,用nslookup解析测试,就是无法正确解析。
日志报的错误:
Sep 20 15:31:10 Linux named[3866]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Sep 20 15:31:10 Linux named[3866]: zone 150.18.172.in-addr.arpa/IN: loading master file ip2name.conf: file not found
Sep 20 15:31:10 Linux named[3866]: zone mycompany.com/IN: loading master file name2ip.conf: file not found
可是,我检查过name2ip和ip2name这两个文件了。放的路径是正确的。不知道为什么会找不到。
[ 本帖最后由 ngcisco 于 2006-9-20 16:21 编辑 ]
错误信息或日志呢?