Start of change

Cache reordering

DNS servers can be configured to use a round-robin manner for ordering the IP addresses that are returned in response to forward lookup requests. The load balancing that this reordering provides is lost if the resolver does not also reorder its cached list of IP addresses in a round-robin manner. If the resolver does not perform cache reordering, the list of IP addresses is always returned in the same order that the information was received from the DNS server, as long as the cache information remains valid.

Starting in z/OS® Communications Server V2R2, you can control whether the resolver reorders the list of cached IP addresses before the resolver returns the list in response to forward lookup resolution requests.
  • Use the CACHEREORDER resolver setup statement to enable system-wide cache reordering.
  • Use the NOCACHEREORDER resolver setup statement to disable system-wide cache reordering.

You can also disable cache reordering for an individual application by specifying NOCACHEREORDER in the TCPIP.DATA file that the application uses.

Rules:
  • If both IPv6 and IPv4 addresses are cached for a host name, the two lists of addresses are managed and reordered independently of each other.
  • The list of IP addresses is reordered independently of which applications issue the forward lookup requests.
  • The list of IP addresses is reordered independently of the type of forward request that the application issues. The forward request can be Start of changegetaddrinfo()End of change or Start of changegethostbyname()End of change.
  • If system-wide cache reordering is enabled, forward lookup requests from applications that have locally disabled cache reordering have no effect on the round-robin processing.
  • If you dynamically change either system-wide or local setting of cache reordering to NOCACHEREORDER, the resolver, on subsequent forward lookup requests, returns the list of IP addresses in the order that the list was cached.
  • The resolver performs the cache reordering function before any address sorting is performed. See Interactions of address sorting and cache reordering for more information.
  • Cache reordering has no effect on reverse lookup requests.

Example

Consider host name reorder.domain that has three IPv6 and four IPv4 addresses that were cached in the following order:
    IPv6 addresses   2001::10:9:1:1
                     2001::10:9:1:2
                     2001::10:9:1:3
    IPv4 addresses   10.9.1.1
                     10.9.1.2
                     10.9.1.3
                     10.9.1.4
If system-wide cache reordering is in effect, the resolver reorders the lists as follows for this sequence of forward lookup requests for reorder.domain:
  1. Application APPLA issues a getaddrinfo() request for IPv4 addresses:
        IPv4 addresses   10.9.1.2
                         10.9.1.3
                         10.9.1.4
                         10.9.1.1
  2. Application APPLD issues a getaddrinfo() request for both IPv4 and IPv6 addresses:
        IPv6 addresses   2001::10:9:1:2
                         2001::10:9:1:3
                         2001::10:9:1:1
        IPv4 addresses   10.9.1.3
                         10.9.1.4
                         10.9.1.1
                         10.9.1.2
  3. Application APPLNOCR, which has NOCACHEREORDER specified in its TCPIP.DATA file, issues a getaddrinfo() request for both IPv4 and IPv6 addresses:
        IPv6 addresses   2001::10:9:1:1
                         2001::10:9:1:2
                         2001::10:9:1:3
        IPv4 addresses   10.9.1.1
                         10.9.1.2
                         10.9.1.3
                         10.9.1.4
  4. Application APPLB issues a gethostbyname() request for IPv4 addresses:
        IPv4 addresses   10.9.1.4
                         10.9.1.1
                         10.9.1.2
                         10.9.1.3
  5. Application APPLC issues a getaddrinfo() request for IPv6 addresses:
        IPv6 addresses   2001::10:9:1:3
                         2001::10:9:1:1
                         2001::10:9:1:2
  6. Application APPLB issues a getaddrinfo() request for both IPv4 and IPv6 addresses:
        IPv6 addresses   2001::10:9:1:1
                         2001::10:9:1:2
                         2001::10:9:1:3
        IPv4 addresses   10.9.1.1
                         10.9.1.2
                         10.9.1.3
                         10.9.1.4
  7. Application APPLB issues a gethostbyname() request for IPv4 addresses:
        IPv4 addresses   10.9.1.2
                         10.9.1.3
                         10.9.1.4
                         10.9.1.1
  8. Application APPLD issues a getaddrinfo() request for both IPv4 and IPv6 addresses:
        IPv6 addresses   2001::10:9:1:2
                         2001::10:9:1:3
                         2001::10:9:1:1
        IPv4 addresses   10.9.1.3
                         10.9.1.4
                         10.9.1.1
                         10.9.1.2
Notes:
  • Because cache reordering does not consider which applications issue the forward lookup requests, Start of changean individual application might get results that suggest that cache reordering is not being performed even though it is being performed.End of change For example, the two requests from APPLD result in the same lists even though requests from other applications result in lists with different orders.
  • Start of changeBecause NOCACHEREORDER is specified in its TCPIP.DATA file, the resolver returns the list of IP addresses in the same order for every request APPLNOCR issues.End of change The requests from APPLNOCR have no effect on the other results where cache reorder is performed.
End of change