转发服务器;
转发服务器------准备3个虚拟机;
将centos6设置为转发服务器;
将centos7设置为DNS服务器;
将centos5设置为客户端;
1、更改/etc/named.conf文件(centos6);
在option选项里添加;
forward only;
forwarders { 192.168.226.133;};
需要更改选项,将yes改为no;
dnssec-enable no;
dnssec-validation no;
2、更改/etc/named.rfc1912.zones文件(centos6);
zone "magedu.com"{
type forward;
forward only;
forwarders {192.168.226.133;};
};
需要注意,centos6的DNS数据库文件,/etc/named.conf,/etc/named.rfc1912.zones;
有无需要注释掉的选项;
ACL
1、准备数据库文件;
#cp -p /var/named/magedu.com.zone /var/named/magedu.com.zone.bj
#cp -p /var/named/magedu.com.zone /var/named/magedu.com.zone.zz
编写数据库文件;
$TTL 1D
@ IN SOA dns1.magedu.com. dnsadmin.magedu.com. (
202 ; serial
10M ; refresh
3M ; retry
1D ; expire
3D ) ; minimum
NS dns1
NS dns2
shanghai NS dns3
dns1 A 192.168.226.133
dns2 A 192.168.226.134
dns3 A 192.168.226.134
websrv A 1.1.1.1------------------只需删除一个websrv 行 ,就可以了;
websrv A 3.3.3.3------------------
ftpsrv A 2.2.2.2
www CNAME websrv
@ MX 10 mailsrv
@ MX 20 mailsrv
mailsrv1 A 6.6.6.6
mailsrv2 A 7.7.7.7
#都访问magedu.com域;
2、编辑/etc/named.conf文件;
顶行添加;表示所访问的客户端地址;
acl beijing {192.168.226.134;};
acl zhengzhou {192.168.226.135;};
acl other {any;};
指明客户端访问的数据库路径的配置文件;
view beijingview {
match-clients {beijing;};
include "/etc/beijing.view.zones";
};
view zhengzhouview {
match-clients {zhengzhou;};
include "/etc/zhengzhou.view.zones";
};
view otherview {
match-clients{other;};
include "/etc/named.rfc1912.zones";
};
将指明dns根路径的文件剪切,删除 include "/etc/named.rfc1912.zones“行;
3、将剪切的dns根路径文件复制到/etc/named.rfc1912.zones配置文件里;
zone "." IN {
type hint;
file "named.ca";
};
4、编辑beijing、zhengzhou的数据库路径配置文件;
/etc/beijing.view.zones
/etc/zhengzhou.view.zones
#vim /etc/beijing.view.zones
zone "magedu.com" IN {
type master;
flie "magedu.com.zone.bj";
};
#vim /etc/zhengzhou.view.zones
zone "magedu.com" IN {
type master;
file "magedu.com.zone.zz";
};
5、使用centos6、centos5进行访问;