Partilhar via


Prioritizing local subnets

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Prioritizing local subnets

By default, the DNS Server service uses local subnet prioritizing as the method for giving preference to IP addresses on the same network when a client query resolves to a host name that is mapped to more than one IP address. This feature requires that the client application attempt to connect to the host using its closest (and typically fastest) IP address available for connection.

The DNS Server service uses local subnet priority as follows:

  1. The DNS Server service determines if local subnet prioritization is needed to order the query response.

    If more than one A resource record (RR) matches the queried host name, the DNS Server service can reorder the records by their subnet location. If the queried host name only matches a single A resource record, or if the IP network address of the client does not match an IP network address for any of the mapped addresses in an answer list of multiple RRs, no prioritizing is necessary.

  2. For each RR in the matched answer list, the DNS Server service determines which records (if any) match the subnet location of the requesting client.

  3. The DNS Server service reorders the answer list so that A RRs which match the local subnet of the requesting client are placed first in the answer list.

  4. Prioritized by subnet order, the answer list is returned to the requesting client.

Simple example: Local network prioritizing

A multihomed computer, multihomed.example.microsoft.com, has three A RRs for its three separate host IP addresses in the example.microsoft.com zone. A separate A RR is used for each of the host's addresses, which appear in this order in the zone:

multihomed   IN  A  192.168.1.27

multihomed   IN  A  10.0.0.14

multihomed   IN  A  172.16.20.4

If a DNS client resolver at IP address 10.4.3.2 queries the server for the IP addresses of host multihomed.example.microsoft.com, the DNS Server service notes that the originating IP network address (10.0.0.0) of the client matches the network (class A) portion of the 10.0.0.4 address in the answer list of RRs. The DNS Server service then reorders the addresses in the response as follows:

multihomed   IN  A  10.0.0.14

multihomed   IN  A  192.168.1.27

multihomed   IN  A  172.16.20.4

If the IP address of the requesting client has no local network match with any of the RRs in the answer list, then the list is not prioritized.

Complex example: Local subnet prioritizing

If you are working in a network that uses IP subnetting (nondefault subnet masks), there are only a few minor differences. If more than one address matches in the network portion, then the matching addresses are further ordered and the RR having the closest matching subnet address is placed first.

For example, a multihomed computer, multihomed.example.microsoft.com, has four A RRs for four separate host IP addresses in the example.microsoft.com zone. Two of these IP addresses are for nonlocal networks. The other two IP addresses share a common IP network address but, because IP subnetting is used, represent different physical subnetted network connections based on their custom (nondefault) subnet mask value of 255.255.248.0. These example RRs appear in the following order in the zone:

multihomed   IN  A  192.168.1.27

multihomed   IN  A  172.16.22.4

multihomed   IN  A  10.0.0.14

multihomed   IN  A  172.16.31.5

If the IP address of the requesting client is 172.16.22.8, both of the IP addresses that match the same IP network as the client, the 172.16.0.0 network, are returned at the top of the answer list to the client. However, in this example, the 172.16.22.4 address is placed ahead of the 172.16.31.5 address because it matches the client IP address down through the 172.16.20.0 subnet address.

The reordered answer list returned by the DNS Server service would be:

multihomed   IN  A  172.16.22.4

multihomed   IN  A  172.16.31.5

multihomed   IN  A  192.168.1.27

multihomed   IN  A  10.0.0.14

Notes

  • IP subnetting is imposed by using a custom or nondefault subnet mask value with all IP addresses on your network. For more information, see Subnet masks.

  • Local subnet priority supersedes the use of round-robin rotation for multihomed names. When round robin is enabled, however, RRs continue to be rotated using round robin as the secondary method of sorting the response list. For more information on round robin, see Configuring round robin.