Package com.netflix.discovery.endpoint
Class DnsResolver
- java.lang.Object
-
- com.netflix.discovery.endpoint.DnsResolver
-
public final class DnsResolver extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.String>getCNamesFromTxtRecord(java.lang.String discoveryDnsName)Looks up the DNS name provided in the JNDI context.static javax.naming.directory.DirContextgetDirContext()Load up the DNS JNDI context provider.static java.lang.Stringresolve(java.lang.String originalHost)Resolve host name to the bottom A-Record or the latest available CNAMEstatic java.util.List<java.lang.String>resolveARecord(java.lang.String rootDomainName)Look into A-record at a specific DNS address.
-
-
-
Method Detail
-
getDirContext
public static javax.naming.directory.DirContext getDirContext()
Load up the DNS JNDI context provider.
-
resolve
public static java.lang.String resolve(java.lang.String originalHost)
Resolve host name to the bottom A-Record or the latest available CNAME- Returns:
- resolved host name
-
resolveARecord
@Nullable public static java.util.List<java.lang.String> resolveARecord(java.lang.String rootDomainName)
Look into A-record at a specific DNS address.- Returns:
- resolved IP addresses or null if no A-record was present
-
getCNamesFromTxtRecord
public static java.util.Set<java.lang.String> getCNamesFromTxtRecord(java.lang.String discoveryDnsName) throws javax.naming.NamingExceptionLooks up the DNS name provided in the JNDI context.- Throws:
javax.naming.NamingException
-
-