split分離解析

split分離解析:不同的ip地址訪問相同的域名,得到不同的解析結果1、安裝軟件包

[root@localhost ~]#yum -y install bind bind-chroot caching-nameserver         //安裝dns

2、修改主配置文件

[root@localhost ~]# cd /var/named/chroot/etc/

[root@localhost etc]# vim named.conf

view yd_resolver {

       match-clients      { 172.100.100.11; };      //指定該ip地址訪問

       match-destinations { any; };

       recursion yes;

       include "/etc/named.rfc1912.zones";

};

view lt_resolver {

       match-clients      { any; };

       match-destinations { any; };

       recursion yes;

       include "/etc/named.rfc.zones";

};

[root@localhost etc]# vim named.rfc1912.zones

...

zone "tarena.com" IN {

      type master;

      file "tarena.com.zone";

};

[root@localhost etc]# cp -p named.rfc1912.zones named.rfc.zones

[root@localhost etc]# vim named.rfc.zones

.. ..

zone ".tarena.com" IN {

      type master;

      file "lt.tarena.com.zone";

};

[root@localhost named]# vim tarena.com.zone

$TTL    86400

@       IN      SOA     tarena.com. root.tarena.com.  (

                                     1997022700 ; Serial

                                     28800      ; Refresh

                                     14400      ; Retry

                                     3600000    ; Expire

                                     86400 )    ; Minimum

       IN      NS      dns1.tarena.com.

dns1    IN    A       172.100.100.253

www    IN    A        2.2.2.2

[root@localhost named]# vim lt.tarena.com.zone

$TTL    86400

@       IN      SOA     lt.tarena.com. root.lt.tarena.com.  (

                                     1997022700 ; Serial

                                     28800      ; Refresh

                                     14400      ; Retry

                                     3600000    ; Expire

                                     86400 )    ; Minimum

      IN      NS      dns1.lt.tarena.com.

dns1    IN    A       172.100.100.253

www    IN    A        1.1.1.1

[root@localhost ~]# service named restart

[root@localhost ~]#chkconfig  named  on

3、客戶機測試:

客戶機1

[root@localhost ~]# host www.tarena.com 172.100.100.253

客戶機2

win7:  nslookup  www.tarena.com


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章