class DnsNameResolver extends NameResolver {

  @VisibleForTesting
  static boolean shouldUseJndi(boolean jndiEnabled, boolean jndiLocalhostEnabled, String target) {
    if (!jndiEnabled) {
      return false;
    }
    if ("localhost".equalsIgnoreCase(target)) {
      return jndiLocalhostEnabled;
    }
    // Check if this name looks like IPv6
    if (target.contains(":")) {
      return false;
    }
    // Check if this might be IPv4.  Such addresses have no alphabetic characters.  This also
    // checks the target is empty.
    boolean alldigits = true;
    for (int i = 0; i < target.length(); i++) {
      char c = target.charAt(i);
      if (c != '.') {
        alldigits &= (c >= '0' && c <= '9');
      }
    }
    return !alldigits;
  }

    DnsNameResolver(@Nullable String nsAuthority, String name, Attributes params,
      Resource<Executor> executorResource, ProxyDetector proxyDetector,
      Stopwatch stopwatch, boolean isAndroid);

}