You want to configure a resolver to sort addresses on certain networks to the front of responses that include multiple A records.
For a BIND 4.9 or later resolver, add a sortlist directive to resolv.conf, telling the resolver which networks to prefer. The arguments to the sortlist directive are either network numbers or network and netmask pairs, separated by a slash ("/"). If you specify just a network number, the resolver assumes you mean the whole class A, B, or C network, as determined by the first two bits of the network. For example, given this sortlist directive, the resolver will sort addresses on the network 128.32/16 to the beginning of the list of addresses that it passes back to applications:
If you specify a network and a netmask, use dotted-octet quantities for both. For example:
Some Windows operating systems, including Windows NT 4.0 after Service Pack 4 and Windows 2000, also include resolvers that sort addresses, though the function isn't particularly configurable. When these resolvers share a subnet with the name server they query, they sort addresses on that subnet to the front of responses they return to applications.
You can turn address sorting off with these resolvers by setting the value of the following Registry key to zero:
Since most applications simple-mindedly use the first address returned before the rest, this configuration induces many applications to prefer addresses in the sortlist. Note, however, that in some cases the sortlist can also prevent round robin from working, since the resolver may sort responses that include matching addresses.
9.5.4 See Also
"The sortlist directive" in Chapter 6 of DNS and BIND; "Subnet Prioritization" in Chapter 6 of DNS on Windows 2000.
BIND Name Server Configuration
BIND Name Server Operations
Delegation and Registration
Interoperability and Upgrading
Resolvers and Programming
Logging and Troubleshooting