Bind 9 Administrator Reference Manual
Chapter 6. BIND 9 Configuration Reference
the maximum distance from the server. If there is no match, the address will get a distance which is
further than any non-negated list element, and closer than any negated element. For example,
topology {
10/8;
!1.2.3/24;
{ 1.2/16; 3/8; };
};
will prefer servers on network 10 the most, followed by hosts on network 1.2.0.0 (netmask 255.255.0.0)
and network 3, with the exception of hosts on network 1.2.3 (netmask 255.255.255.0), which is preferred
least of all.
The default topology is
topology { localhost; localnets; };
Note: The topology option is not implemented in BIND 9.
6.2.14.11. The sortlist Statement
The response to a DNS query may consist of multiple resource records (RRs) forming a resource records
set (RRset). The name server will normally return the RRs within the RRset in an indeterminate order
(but see the rrset-order statement in Section 6.2.14.12). The client resolver code should rearrange the
RRs as appropriate, that is, using any addresses on the local net in preference to other addresses.
However, not all resolvers can do this or are correctly configured. When a client is using a local server
the sorting can be performed in the server, based on the client’s address. This only requires configuring
the nameservers, not all the clients.
The sortlist statement (see below) takes an address_match_list and interprets it even more specifically
than the topology statement does (Section 6.2.14.10). Each top level statement in the sortlist must itself
be an explicit address_match_list with one or two elements. The first element (which may be an IP
address, an IP prefix, an ACL name or a nested address_match_list) of each top level list is checked
against the source address of the query until a match is found.
Once the source address of the query has been matched, if the top level statement contains only one
element, the actual primitive element that matched the source address is used to select the address in the
response to move to the beginning of the response. If the statement is a list of two elements, then the
second element is treated the same as the address_match_list in a topology statement. Each top level
element is assigned a distance and the address in the response with the minimum distance is moved to
the beginning of the response.
73