cancel
Showing results for 
Search instead for 
Did you mean: 

BIND DNS record

SOLVED
Go to solution
manuj kumar
Frequent Advisor

BIND DNS record

how to add two A records in bind dns, the two should have the same HOSTNAME but different IP address.
the scenario is, when DNS detects the first IP is unreachable it will directly use the second record with the second IP to refer to the same HOSTNAME.

thanks
1 REPLY
Matti_Kurkela
Honored Contributor
Solution

Re: BIND DNS record

> how to add two A records in bind dns, the two should have the same HOSTNAME but different IP address.

Just write two A records, like this:

hostname IN A 111.111.111.111
hostname IN A 222.222.222.222

The DNS server will return both records to the client asking for the A record of "hostname". The records will normally be returned in round-robin order, i.e. the first answer has 111.111.111.111 listed as the first address, the second answer lists 222.222.222.222 as the first one, etc.

> the scenario is, when DNS detects the first IP is unreachable it will directly use the second record

This is a nice theory, but unfortunately it won't work so well in practice.

The DNS server won't check the reachability of the IPs: that is not its job. Whether the DNS server can reach some IP or not has no bearing on whether the client can reach it too. Sometimes the client is authorized to access some things the DNS server is forbidden to access; sometimes the client may be blocked from accessing some IP addresses, either intentionally or otherwise.

Besides, the only sure way to test if an IP address is reachable is to try and access it. If the host responds immediately, either positively (connection accepted) or negatively (with a TCP reset or an ICMP error packet), there is no problem. But what to do when there is no answer at all? If you're attempting a TCP connection, the standard says you should wait up to 1-3 minutes while retransmitting the connection request multiple times. For a WWW application, this is clearly too slow: the user will often run out of patience before the timeout expires.

Most web browsers will use multiple sockets and other strategies to achieve faster response. Because of this, the DNS round-robin is not suitable as a high-availability solution for HTTP services: a common result is that when one of the servers is unreachable, you'll get a partially-loaded web page with some individual images and other page elements missing/broken.

MK
MK