LINUX下构建DNS的基本主辅框架( 二 )

[root@localhost ~]# nslookup//以下测试可知正反解都可以成功> 192.168.1.195Server:192.168.1.193Address:192.168.1.193#53 
195.1.168.192.in-addr.arpaname = www1.ethnicity.com.> www2.ethnicity.comServer:192.168.1.193Address:192.168.1.193#53 Name:www2.ethnicity.comAddress: 192.168.1.196> exit最后把配置文件同步到辅服务器上
[root@localhost ~]# scp /var/named/chroot/etc/named.conf 192.168.1.195:/var/named/chroot/etc/[root@localhost~]#scp /var/named/chroot/etc/named.rfc1912.zones 192.168.1.195:/var/named/chroot/etc/第二:在辅服务器上的设置
[root@localhost ~]# chgrp named /var/named/chroot/etc/named.conf[root@localhost etc]# ln -s /var/named/chroot/etc/named.conf /etc/named.conf[root@localhost ~]# vi /etc/named.conflisten-on port 53 { any; };forwarders{202.102.240.65;};allow-query{ any; };allow-query-cache { any; };match-clients{ any; };match-destinations { any; };[root@localhost ~]# vi /etc/named.rfc1912.zones//添加以下的域zone "ethnicity.com" IN {type slave;file "slaves/named.ethnicity.com";masters { 192.168.1.193; };}; 
zone "1.168.192.in-addr.arpa" IN {type slave;file "slaves/named.192.168.1";masters { 192.168.1.193; };};[root@localhost ~]# /etc/init.d/named restart//重启服务器就可以看到辅服务器的配置文件[root@localhost ~]# ll /var/named/chroot/var/named/slaves/total 16-rw-rw-r-- 1 named named 398 Oct 25 07:06 named.192.168.1-rw-r--r-- 1 named named 466 Oct 25 07:42 named.ethnicity.com第三:测试的部分
这个步骤主要是观察在主服务器修改配置文件是 , 通过#rndc reload时 , 辅服务器数据的同步状况 。
[root@localhost named]# vi named.ethnicity.com//在主服务器域文件内添加两个CNAME 。并且修改46; serial (d. adams)  $TTL86400@IN SOAdns.ethnicity.com.root.ethnicity.com. (46; serial (d. adams)3H; refresh15M; retry1W; expiry1D ); minimum 
IN NSdns.ethnicity.com.@IN MX 10mail.ethnicity.com.www1IN A192.168.1.195www2IN A192.168.1.196www3IN A192.168.1.193linuxIN CNAMEwww2wanyanIN CNAMEwww3ethnicityIN CNAMEwww1[root@localhost named]# rndc reloadserver reload successful接着在辅服务器上查看变化 , 发现和主服务器是数据同步的 。
[root@localhost ~]# cat /var/named/chroot/var/named/slaves/named.ethnicity.com$ORIGIN .$TTL 86400; 1 dayethnicity.comIN SOAdns.ethnicity.com. root.ethnicity.com. (46; serial10800; refresh (3 hours)900; retry (15 minutes)604800; expire (1 week)86400; minimum (1 day))NSdns.ethnicity.com.MX10 mail.ethnicity.com.$ORIGIN ethnicity.com.ethnicityCNAMEwww1linuxCNAMEwww2wanyanCNAMEwww3www1A192.168.1.195www2A192.168.1.196www3A192.168.1.193 

LINUX下构建DNS的基本主辅框架

文章插图
 




推荐阅读