code: protected DnsServerAddressStream newRedirectDnsServerStream(
              @SuppressWarnings("unused") String hostname, List<InetSocketAddress> nameservers) {
          DnsServerAddressStream cached = authoritativeDnsServerCache().get(hostname);
          if (cached == null || cached.size() == 0) {
              // If there is no cache hit (which may be the case for example when a NoopAuthoritativeDnsServerCache
              // is used), we will just directly use the provided nameservers.
              Collections.sort(nameservers, nameServerComparator);
              return new SequentialDnsServerAddressStream(nameservers, 0);
          }
          return cached;
      }
docs: Creates a new {@link DnsServerAddressStream} to following a redirected DNS query. By overriding this
  it provides the opportunity to sort the name servers before following a redirected DNS query.
  
  @param hostname the hostname.
  @param nameservers The addresses of the DNS servers which are used in the event of a redirect. This may
  contain resolved and unresolved addresses so the used {@link DnsServerAddressStream} must
  allow unresolved addresses if you want to include these as well.
  @return A {@link DnsServerAddressStream} which will be used to follow the DNS redirect or {@code null} if
  none should be followed.