1.环境
Centos 6.5
bind
关闭防火墙和SELINUX
2.安装bind服务软件
yum -y install bind
3.配制主配制文件/etc/name.conf
options {
listen-on port 53 { any; }; #配制为any
// listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
forward first;
forwarders {202.101.172.35; }; #dns 转发器
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; }; #配制为any
recursion yes;
dnssec-enable no; #局域网内的dns 为非法 关闭安全功能
dnssec-validation no; #局域网内的dns 为非法 关闭安全功能
4.配制区域文件vim /etc/named.rfc1912.zones
zone "chen.cn" IN { #正向解析文件
type master; #主DNS
file "chen.cn.zone"; #文件名称
};
zone "9.16.172.in-addr.arpa" IN { #反向解析文件
type master; #主DNS
file "172.16.9.rev"; #文件名称
};
5.配制正向解析vim /var/named/chen.cn.zone
$TTL 1D
@ IN SOA dns.chen.cn. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS dns.chen.cn.
NS dns2.chen.cn.
dns A 172.16.9.13
dns2 A 172.16.9.14
www A 172.16.9.128
6.配制反向解析 vim /var/named/172.16.9.rev
$TTL 1D
@ IN SOA dns.chen.cn. rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
3H ) ; minimum
NS dns.chen.cn.
NS dns2.chen.cn.
13 PTR dns.chen.cn.
14 PTR dns2.chen.cn.
128 PTR www.chen.cn.
7.配制丛DNS服务器:主配制一样。区域配制文件
zone "chen.cn" IN {
type slave;
file "slaves/chen.cn.zone";
masters {172.16.9.13; };
};
zone "9.16.172.in-addr.arpa" IN {
type slave;
file "slaves/172.16.9.rev";
masters {172.16.9.13; };
};