【主DNS服务器-IP地址:192.168.18.115】
安装DNS服务
yum install bind-*
配置bind
vim /var/named/chroot/etc/named.conf
options{
directory "var/named";
};
zone "zzp.com" {
type master;
file "zzp.com.zone";
allow-transfer {192.168.18.116;};
};
zone "18.168.192.in-addr.arpa" {
type master;
file "zzp.com.192.168.18";
allow-transfer {192.168.18.116;};
};
配置正向区域文件zzp.com.zone
#cp /usr/share/doc/bind-9.3.6/sample/var/named/localhost.zone /var/named/chroot/var/named/zzp.com.zone
#vim /var/named/chroot/var/named/zzp.com.zone
zzp.com. IN NS master.zzp.com.
master
IN A
192.168.18.115
www IN A 192.168.18.115
配置反向区域文件zzp.com.192.168.18
#cp /var/named/chroot/var/named/zzp.com.zone /var/named/chroot/var/named/zzp.com.192.168.18
#vim /var/named/chroot/var/named/zzp.com.192.168.18
IN NS @
115 IN PTR www.zzp.com.
重启DNS服务
service named restart
【辅助DNS服务器-192.168.18.116】
安装DNS服务
配置bind
#vim /var/named/chroot/etc/named.conf
options {
directory "var/named";
};
zone "zzp.com" {
type slave;
file "zzp.com.zone";
masters {192.168.18.115; };
};
zone "18.168.192.in-addr.arpa" {
type slave;
file "zzp.com.192.168.18";
masters {192.168.18.115; };
};
【更改dns服务区域文件属性】
chmod g+w /var/named/chroot/var/named
service named restart
【配置DNS转发服务器-IP地址:192.168.18.117】
配置条件转发服务器
vim /var/named/chroot/etc/named.conf
#options {
# directory "var/named";
# recursion yes;
# forwarders {192.168.18.115;192.168.18.116;};
# forward only;
#};
};
【客户端-设置客户机的DNS为192.168.18.117】
完成测试!