返回列表 回复 发帖

bind9实现3dns功能

Greetings:



In following steps, we’re able to setup a dns that reply different sequence of type A resource record based on dns query client’s IP addr.



We’re going to setup DNS server at 172.18.149.8, and two client is 172.18.5.31 and 172.18.5.35

When 172.18.5.31 request A record for www.the9.com, first return 6, then return 5

When 172.18.5.35 request A record for www.the9.com, first return 3, then return 7

P.S. we here use IP address(172.18.5.31), we can use IP-range as well (e.g. 10/8)



In 172.18.149.8, DNS named.conf

sortlist {

{localhost;{localnets;172.18.149.7;{172.18.149.6;172.18.149.5;};};};

{172.18.5.31;{172.18.149.6;{172.18.149.5;};};};

{172.18.5.35;{172.18.149.3;{172.18.149.7;};};};

};

};

zone "the9.com" {

        type master;

        file "the9.com";

};



In 172.18.149.8, the9.com

$TTL    0

@       IN      SOA     ns.the9.com. root.localhost.  (

                                      2997232700 ; Serial

                                      28800      ; Refresh

                                      14400      ; Retry

                                      3600000    ; Expire

                                      86400 )    ; Minimum

              IN      NS      ns.the9.com.

ns              IN      A       172.18.149.8

www             IN      A       172.18.149.3

www             IN      A       172.18.149.4

www             IN      A       172.18.149.5

www             IN      A       172.18.149.6

www             IN      A       172.18.149.7





in 172.18.5.31, it’s a linux,

[root@cc9c root]# host www.the9.com free8

Using domain server:

Name: free8

Address: 172.18.149.8#53

Aliases:



www.the9.com has address 172.18.149.6

www.the9.com has address 172.18.149.5

www.the9.com has address 172.18.149.3

www.the9.com has address 172.18.149.4

www.the9.com has address 172.18.149.7



in 172.18.5.35, it’s a windows

nslookup

> server 172.18.149.8

DNS request timed out.

    timeout was 2 seconds.

Default Server:  [172.18.149.8]

Address:  172.18.149.8



> www.the9.com

Server:  [172.18.149.8]

Address:  172.18.149.8



Name:    www.the9.com

Addresses:  172.18.149.3, 172.18.149.7, 172.18.149.4, 172.18.149.5

          172.18.149.6



>



succeed
不错哈。
好文章,收藏了.谢谢楼主共享.
学到了。.谢谢楼主共享.
返回列表
开源邮件服务器 开源邮件服务器 web 开源邮件 开源 mail 开源 邮件服务器 邮件技术 mail技术 反垃圾邮件 反垃圾mail mail投递
邮件服务器 mail服务器 开源软件 mail软件 mail服务新品牌 开源邮件服务新品牌
开源mail服务新网站 邮件服务新品牌 mail tmail mailserver 163邮件 sendmail |Linux维护|Linux代维|成都Linux维护|成都Linux代维