Class 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.DirContext getDirContext()
      Load up the DNS JNDI context provider.
      static java.lang.String resolve​(java.lang.String originalHost)
      Resolve host name to the bottom A-Record or the latest available CNAME
      static java.util.List<java.lang.String> resolveARecord​(java.lang.String rootDomainName)
      Look into A-record at a specific DNS address.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.NamingException
        Looks up the DNS name provided in the JNDI context.
        Throws:
        javax.naming.NamingException