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 |