name server should always return the
backup's address after the primary web server's address.
But you can't do that with round robin; it'll just rotate
the order of the addresses in successive responses.
BIND 8.2 and later name servers -- but not BIND 9 name servers, as
of 9.1.0 -- allow you to turn off round robin for certain domain
names and types of records. For example, if we wanted to ensure that
the address records for www.movie.edu were
always returned in the same order, we could use this
rrset-order substatement:
options {
rrset-order {
class IN type A name "www.movie.edu" order fixed;
};
};
We should probably lower the TTL on
www.movie.edu's address records, too, so a
name server that cached the records wouldn't round robin them
for long.
The class, type, and
name settings determine which records the
specified order applies to. The class defaults to IN, type to ANY,
and name to * -- in other words, any records. So the statement:
options {
rrset-order {
order random;
};
};
applies a random order to all records returned by the name server.
The name setting may contain a wildcard as its leftmost label, as in:
options {
rrset-order {
type A name "*.movie.edu" order cyclic;
};
};
Only one rrset-order substatement is permitted,
but it can contain multiple order specifications. The first order
specification to match a set of records in a response applies.
rrset-order supports three (count 'em,
three!) different orders:
- fixed
- Always return matching records in the same order
- random
- Return matching records in random order
- cyclic
- Return matching records in cyclic (round robin) order
The default behavior is:
options {
rrset-order {
class IN type ANY name "*" order cyclic;
};
};
Configuring rrset-order is far from a complete
solution, unfortunately, because resolver and name server caching can
interfere with its operation. A better long-term solution is the SRV
record, which we'll discuss.