public static String getDefaultHost(String strInterface, String nameserver)
    throws UnknownHostException {
    if (HAS_NEW_DNS_GET_DEFAULT_HOST_API) {
      try {
        // Hadoop-2.8 includes a String, String, boolean variant of getDefaultHost
        // which properly handles multi-homed systems with Kerberos.
        return (String) GET_DEFAULT_HOST_METHOD.invoke(null, strInterface, nameserver, true);
      } catch (Exception e) {
        // If we can't invoke the method as it should exist, throw an exception
        throw new RuntimeException("Failed to invoke DNS.getDefaultHost via reflection", e);
      }
    } else {
      return org.apache.hadoop.net.DNS.getDefaultHost(strInterface, nameserver);
    }
  }
Wrapper around DNS.getDefaultHost(String, String), calling DNS.getDefaultHost(String, String,
boolean) when available.
@param strInterface The network interface to query.
@param nameserver   The DNS host name.
@return The default host names associated with IPs bound to the network interface.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/DNS.java