Class SecurityUtil.QualifiedHostResolver

java.lang.Object
org.apache.hadoop.security.SecurityUtil.QualifiedHostResolver
Enclosing class:
SecurityUtil

protected static class SecurityUtil.QualifiedHostResolver extends Object
This an alternate resolver with important properties that the standard java resolver lacks: 1) The hostname is fully qualified. This avoids security issues if not all hosts in the cluster do not share the same search domains. It also prevents other hosts from performing unnecessary dns searches. In contrast, InetAddress simply returns the host as given. 2) The InetAddress is instantiated with an exact host and IP to prevent further unnecessary lookups. InetAddress may perform an unnecessary reverse lookup for an IP. 3) A call to getHostName() will always return the qualified hostname, or more importantly, the IP if instantiated with an IP. This avoids unnecessary dns timeouts if the host is not resolvable. 4) Point 3 also ensures that if the host is re-resolved, ex. during a connection re-attempt, that a reverse lookup to host and forward lookup to IP is not performed since the reverse/forward mappings may not always return the same IP. If the client initiated a connection with an IP, then that IP is all that should ever be contacted. NOTE: this resolver is only used if: hadoop.security.token.service.use_ip=false