首 页文章中心

Linux学习网

您的位置Linux学习网 > Linux服务器应用 > 文章内容

DNS服务器的配置注意点(正反解析)

作者:佚名  来源:不详  发布时间:2008-6-21 10:26:00
Redhat Linux AS4下
如果需要配置域为whb.com的解析文件,那么如下
class=codetop>CODE: class=codemain>[root@as4-raid named]# cat /var/named/chroot/var/named/whb.zone

$TTL 86400
@ IN SOA @ root.whb.com (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS dns1
IN NS dns2
IN MX 10 mail
IN A 1.1.1.1
dns1 IN A 1.1.1.2
dns2 IN A 1.1.1.3
www IN A 1.1.1.4
mail IN A 1.1.1.5
test IN A 1.1.1.6

然后在/var/named/chroot/etc/named.conf中增加一段配置,如下

zone "whb.com" IN {
type master;
file "whb.zone";
allow-update { none; };
};
class=codetop>CODE: class=codemain>[root@as4-raid ~]# nslookup www.whb.com
Server: 127.0.0.1
Address: 127.0.0.1#53

Name: www.whb.com
Address: 1.1.1.4


配置时那个红色的 @ 不能漏掉,还有在配置带MX记录的解析时那个数字10(可以为任何数字,一般是1-10)
不能漏

反向解析配置文件
class=codetop>CODE: class=codemain>[root@as4-raid ~]# cat /var/named/chroot/var/named/whb.local

$TTL 86400
@ IN SOA root. whb.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS whb.com.
1 IN PTR .
2 IN PTR dns1.whb.com.
3 IN PTR dns2.whb.com.
4 IN PTR www.whb.com.
5 IN PTR mail.whb.com.
6 IN PTR test.whb.com.

然后在/var/named/chroot/etc/named.conf中增加一段配置,如下

zone "1.1.1.in-addr.arpa" IN {
type master;
file "whb.local";
allow-update { none; };
};
class=codetop>CODE: class=codemain>[root@as4-raid ~]# nslookup 1.1.1.4
Server: 127.0.0.1
Address: 127.0.0.1#53

4.1.1.1.in-addr.arpa name = www.whb.com.

收藏本页到: 365Key | del.icio.us | | 添加到雅虎收藏+
  • 网站帮助 - 广告合作 - 网站地图