boolean matchesHostname(String hostSpec, String remoteAddress) {
    // We assume this is a hostname... convert it to an IP address
    try {
      String ipAddress = getIpAddress(hostSpec);
      if (StringUtils.isNotEmpty(ipAddress) && ipAddress.equals(remoteAddress)) {
        return true;
      }
    } catch (Throwable t) {
      LOG.warn("Invalid hostname in host specification, skipping: " + hostSpec, t);
    }

    return false;
  }
Constructor.
<p>
Given the Ambari {@link Configuration}, initializes the {@link KerberosName} class using
the <code>auth-to-local</code> rules from {@link AmbariKerberosAuthenticationProperties#getAuthToLocalRules()}.

@param configuration the Ambari configuration data
@param users         the Ambari users access object
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariProxiedUserDetailsService.java