天高任鸟飞,海阔凭鱼跃
分类: LINUX
2010-07-14 12:43:12
构建主域名服务器
实现方法:
1.确认本机的主机名、IP地址
#ifconfig /all
#vi etc/resolv.conf (添加以下配置)
Nameserver 172.16.16.9
2.建立主配置文件:
#vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
};
zone "benet.com" IN{
type master;
file "benet.com.zone";
allow-transfer { 172.16.16.10; };
};
zone "16.16.172.in-addr.arpa" IN {
type master;
file "172.16.16.arpa";
allow-transfer { 172.16.16.10; };
};
3.建立正向解析区域数据库文件
#vi /var/named/chroot/var/named/benet.com.zone
$TTL 86400
@ SOA benet.com. admin.benet.com. (
2010050601
4H
12H
1D
)
@ IN NS ns1.benet.com.
IN NS ns2.benet.com.
IN A 172.16.16.9
IN MX 10 mail.benet.com.
ns1 IN A 172.16.16.9
ns2 IN A 172.16.16.10
mail IN A 172.16.16.1
www IN A 172.16.16.1
study IN A 172.16.16.2
* IN A 172.16.16.1
4.建立反向解析区域数据库文件
#vi /var/named/chroot/var/named/172.16.16.arpa
$TTL 86400
@ SOA benet.com. admin.benet.com. (
2010050601
4H
12H
1D
)
IN NS ns1.benet.com.
IN NS ns2.benet.com.
1 IN PTR
2 IN PTR study.benet.com.
9 IN PTR ns1.benet.com.
10 IN PTR ns2.benet.com.
5.重启named服务
#service named start