Class DnsNameResolver

  • All Implemented Interfaces:
    io.netty5.resolver.NameResolver<InetAddress>, Closeable, AutoCloseable

    public class DnsNameResolver
    extends io.netty5.resolver.InetNameResolver
    A DNS-based InetNameResolver.
    • Constructor Summary

      Constructors 
      Constructor Description
      DnsNameResolver​(io.netty5.channel.EventLoop eventLoop, io.netty5.channel.ChannelFactory<? extends io.netty5.channel.socket.DatagramChannel> channelFactory, DnsCache resolveCache, AuthoritativeDnsServerCache authoritativeDnsServerCache, DnsQueryLifecycleObserverFactory dnsQueryLifecycleObserverFactory, long queryTimeoutMillis, io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes, boolean recursionDesired, int maxQueriesPerResolve, int maxPayloadSize, boolean optResourceEnabled, io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver, DnsServerAddressStreamProvider dnsServerAddressStreamProvider, String[] searchDomains, int ndots, boolean decodeIdn)
      Deprecated.
      DnsNameResolver​(io.netty5.channel.EventLoop eventLoop, io.netty5.channel.ChannelFactory<? extends io.netty5.channel.socket.DatagramChannel> channelFactory, DnsCache resolveCache, DnsCache authoritativeDnsServerCache, DnsQueryLifecycleObserverFactory dnsQueryLifecycleObserverFactory, long queryTimeoutMillis, io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes, boolean recursionDesired, int maxQueriesPerResolve, int maxPayloadSize, boolean optResourceEnabled, io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver, DnsServerAddressStreamProvider dnsServerAddressStreamProvider, String[] searchDomains, int ndots, boolean decodeIdn)
      Deprecated.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AuthoritativeDnsServerCache authoritativeDnsServerCache()
      Returns the cache used for authoritative DNS servers for a domain.
      void close()
      Closes the internal datagram channel used for sending and receiving DNS messages, and clears all DNS resource records from the cache.
      DnsCnameCache cnameCache()
      Returns the DnsCnameCache.
      protected void doResolve​(String inetHost, io.netty5.handler.codec.dns.DnsRecord[] additionals, io.netty5.util.concurrent.Promise<InetAddress> promise, DnsCache resolveCache)
      Hook designed for extensibility so one can pass a different cache on each resolution attempt instead of using the global one.
      protected void doResolve​(String inetHost, io.netty5.util.concurrent.Promise<InetAddress> promise)  
      protected void doResolveAll​(String inetHost, io.netty5.handler.codec.dns.DnsRecord[] additionals, io.netty5.util.concurrent.Promise<List<InetAddress>> promise, DnsCache resolveCache)
      Hook designed for extensibility so one can pass a different cache on each resolution attempt instead of using the global one.
      protected void doResolveAll​(String inetHost, io.netty5.util.concurrent.Promise<List<InetAddress>> promise)  
      protected io.netty5.channel.EventLoop executor()  
      io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver()
      Returns the component that tries to resolve hostnames against the hosts file prior to asking to remotes DNS servers.
      boolean isOptResourceEnabled()
      Returns the automatic inclusion of a optional records that tries to give the remote DNS server a hint about how much data the resolver can read per response is enabled.
      boolean isRecursionDesired()
      Returns true if and only if this resolver sends a DNS query with the RD (recursion desired) flag set.
      static boolean isTimeoutError​(Throwable cause)
      Returns true if the Throwable was caused by an timeout.
      static boolean isTransportOrTimeoutError​(Throwable cause)
      Returns true if the Throwable was caused by an timeout or transport error.
      int maxPayloadSize()
      Returns the capacity of the datagram packet buffer (in bytes).
      int maxQueriesPerResolve()
      Returns the maximum allowed number of DNS queries to send when resolving a host name.
      protected DnsServerAddressStream newRedirectDnsServerStream​(String hostname, List<InetSocketAddress> nameservers)
      Creates a new DnsServerAddressStream to following a redirected DNS query.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question)
      Sends a DNS query with the specified question.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question, io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
      Sends a DNS query with the specified question.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
      Sends a DNS query with the specified question with additional records.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr, io.netty5.handler.codec.dns.DnsQuestion question)
      Sends a DNS query with the specified question using the specified name server list.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr, io.netty5.handler.codec.dns.DnsQuestion question, io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
      Sends a DNS query with the specified question using the specified name server list.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr, io.netty5.handler.codec.dns.DnsQuestion question, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
      Sends a DNS query with the specified question with additional records using the specified name server list.
      io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr, io.netty5.handler.codec.dns.DnsQuestion question, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals, io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
      Sends a DNS query with the specified question with additional records using the specified name server list.
      long queryTimeoutMillis()
      Returns the timeout of each DNS query performed by this resolver (in milliseconds).
      io.netty5.util.concurrent.Future<InetAddress> resolve​(String inetHost, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
      Resolves the specified name into an address.
      io.netty5.util.concurrent.Future<InetAddress> resolve​(String inetHost, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals, io.netty5.util.concurrent.Promise<InetAddress> promise)
      Resolves the specified name into an address.
      io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question)
      Resolves the DnsRecords that are matched by the specified DnsQuestion.
      io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
      Resolves the DnsRecords that are matched by the specified DnsQuestion.
      io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals, io.netty5.util.concurrent.Promise<List<io.netty5.handler.codec.dns.DnsRecord>> promise)
      Resolves the DnsRecords that are matched by the specified DnsQuestion.
      io.netty5.util.concurrent.Future<List<InetAddress>> resolveAll​(String inetHost, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
      Resolves the specified host name and port into a list of address.
      io.netty5.util.concurrent.Future<List<InetAddress>> resolveAll​(String inetHost, Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals, io.netty5.util.concurrent.Promise<List<InetAddress>> promise)
      Resolves the specified host name and port into a list of address.
      DnsCache resolveCache()
      Returns the resolution cache.
      io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes()
      Returns the ResolvedAddressTypes resolved by SimpleNameResolver.resolve(String).
      • Methods inherited from class io.netty5.resolver.InetNameResolver

        asAddressResolver
      • Methods inherited from class io.netty5.resolver.SimpleNameResolver

        resolve, resolve, resolveAll, resolveAll
    • Constructor Detail

      • DnsNameResolver

        @Deprecated
        public DnsNameResolver​(io.netty5.channel.EventLoop eventLoop,
                               io.netty5.channel.ChannelFactory<? extends io.netty5.channel.socket.DatagramChannel> channelFactory,
                               DnsCache resolveCache,
                               DnsCache authoritativeDnsServerCache,
                               DnsQueryLifecycleObserverFactory dnsQueryLifecycleObserverFactory,
                               long queryTimeoutMillis,
                               io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes,
                               boolean recursionDesired,
                               int maxQueriesPerResolve,
                               int maxPayloadSize,
                               boolean optResourceEnabled,
                               io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver,
                               DnsServerAddressStreamProvider dnsServerAddressStreamProvider,
                               String[] searchDomains,
                               int ndots,
                               boolean decodeIdn)
        Deprecated.
        Creates a new DNS-based name resolver that communicates with the specified list of DNS servers.
        Parameters:
        eventLoop - the EventLoop which will perform the communication with the DNS servers
        channelFactory - the ChannelFactory that will create a DatagramChannel
        resolveCache - the DNS resolved entries cache
        authoritativeDnsServerCache - the cache used to find the authoritative DNS server for a domain
        dnsQueryLifecycleObserverFactory - used to generate new instances of DnsQueryLifecycleObserver which can be used to track metrics for DNS servers.
        queryTimeoutMillis - timeout of each DNS query in millis
        resolvedAddressTypes - the preferred address types
        recursionDesired - if recursion desired flag must be set
        maxQueriesPerResolve - the maximum allowed number of DNS queries for a given name resolution
        maxPayloadSize - the capacity of the datagram packet buffer
        optResourceEnabled - if automatic inclusion of a optional records is enabled
        hostsFileEntriesResolver - the HostsFileEntriesResolver used to check for local aliases
        dnsServerAddressStreamProvider - The DnsServerAddressStreamProvider used to determine the name servers for each hostname lookup.
        searchDomains - the list of search domain (can be null, if so, will try to default to the underlying platform ones)
        ndots - the ndots value
        decodeIdn - true if domain / host names should be decoded to unicode when received. See rfc3492.
      • DnsNameResolver

        @Deprecated
        public DnsNameResolver​(io.netty5.channel.EventLoop eventLoop,
                               io.netty5.channel.ChannelFactory<? extends io.netty5.channel.socket.DatagramChannel> channelFactory,
                               DnsCache resolveCache,
                               AuthoritativeDnsServerCache authoritativeDnsServerCache,
                               DnsQueryLifecycleObserverFactory dnsQueryLifecycleObserverFactory,
                               long queryTimeoutMillis,
                               io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes,
                               boolean recursionDesired,
                               int maxQueriesPerResolve,
                               int maxPayloadSize,
                               boolean optResourceEnabled,
                               io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver,
                               DnsServerAddressStreamProvider dnsServerAddressStreamProvider,
                               String[] searchDomains,
                               int ndots,
                               boolean decodeIdn)
        Deprecated.
        Creates a new DNS-based name resolver that communicates with the specified list of DNS servers.
        Parameters:
        eventLoop - the EventLoop which will perform the communication with the DNS servers
        channelFactory - the ChannelFactory that will create a DatagramChannel
        resolveCache - the DNS resolved entries cache
        authoritativeDnsServerCache - the cache used to find the authoritative DNS server for a domain
        dnsQueryLifecycleObserverFactory - used to generate new instances of DnsQueryLifecycleObserver which can be used to track metrics for DNS servers.
        queryTimeoutMillis - timeout of each DNS query in millis
        resolvedAddressTypes - the preferred address types
        recursionDesired - if recursion desired flag must be set
        maxQueriesPerResolve - the maximum allowed number of DNS queries for a given name resolution
        maxPayloadSize - the capacity of the datagram packet buffer
        optResourceEnabled - if automatic inclusion of a optional records is enabled
        hostsFileEntriesResolver - the HostsFileEntriesResolver used to check for local aliases
        dnsServerAddressStreamProvider - The DnsServerAddressStreamProvider used to determine the name servers for each hostname lookup.
        searchDomains - the list of search domain (can be null, if so, will try to default to the underlying platform ones)
        ndots - the ndots value
        decodeIdn - true if domain / host names should be decoded to unicode when received. See rfc3492.
    • Method Detail

      • newRedirectDnsServerStream

        protected DnsServerAddressStream newRedirectDnsServerStream​(String hostname,
                                                                    List<InetSocketAddress> nameservers)
        Creates a new DnsServerAddressStream to following a redirected DNS query. By overriding this it provides the opportunity to sort the name servers before following a redirected DNS query.
        Parameters:
        hostname - the hostname.
        nameservers - The addresses of the DNS servers which are used in the event of a redirect. This may contain resolved and unresolved addresses so the used DnsServerAddressStream must allow unresolved addresses if you want to include these as well.
        Returns:
        A DnsServerAddressStream which will be used to follow the DNS redirect or null if none should be followed.
      • resolveCache

        public DnsCache resolveCache()
        Returns the resolution cache.
      • authoritativeDnsServerCache

        public AuthoritativeDnsServerCache authoritativeDnsServerCache()
        Returns the cache used for authoritative DNS servers for a domain.
      • queryTimeoutMillis

        public long queryTimeoutMillis()
        Returns the timeout of each DNS query performed by this resolver (in milliseconds). The default value is 5 seconds.
      • resolvedAddressTypes

        public io.netty5.resolver.ResolvedAddressTypes resolvedAddressTypes()
        Returns the ResolvedAddressTypes resolved by SimpleNameResolver.resolve(String). The default value depends on the value of the system property "java.net.preferIPv6Addresses".
      • isRecursionDesired

        public boolean isRecursionDesired()
        Returns true if and only if this resolver sends a DNS query with the RD (recursion desired) flag set. The default value is true.
      • maxQueriesPerResolve

        public int maxQueriesPerResolve()
        Returns the maximum allowed number of DNS queries to send when resolving a host name. The default value is 8.
      • maxPayloadSize

        public int maxPayloadSize()
        Returns the capacity of the datagram packet buffer (in bytes). The default value is 4096 bytes.
      • isOptResourceEnabled

        public boolean isOptResourceEnabled()
        Returns the automatic inclusion of a optional records that tries to give the remote DNS server a hint about how much data the resolver can read per response is enabled.
      • hostsFileEntriesResolver

        public io.netty5.resolver.HostsFileEntriesResolver hostsFileEntriesResolver()
        Returns the component that tries to resolve hostnames against the hosts file prior to asking to remotes DNS servers.
      • close

        public void close()
        Closes the internal datagram channel used for sending and receiving DNS messages, and clears all DNS resource records from the cache. Attempting to send a DNS query or to resolve a domain name will fail once this method has been called.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface io.netty5.resolver.NameResolver<InetAddress>
        Overrides:
        close in class io.netty5.resolver.SimpleNameResolver<InetAddress>
      • executor

        protected io.netty5.channel.EventLoop executor()
        Overrides:
        executor in class io.netty5.resolver.SimpleNameResolver<InetAddress>
      • resolve

        public final io.netty5.util.concurrent.Future<InetAddress> resolve​(String inetHost,
                                                                           Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
        Resolves the specified name into an address.
        Parameters:
        inetHost - the name to resolve
        additionals - additional records (OPT)
        Returns:
        the address as the result of the resolution
      • resolve

        public final io.netty5.util.concurrent.Future<InetAddress> resolve​(String inetHost,
                                                                           Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals,
                                                                           io.netty5.util.concurrent.Promise<InetAddress> promise)
        Resolves the specified name into an address.
        Parameters:
        inetHost - the name to resolve
        additionals - additional records (OPT)
        promise - the Promise which will be fulfilled when the name resolution is finished
        Returns:
        the address as the result of the resolution
      • resolveAll

        public final io.netty5.util.concurrent.Future<List<InetAddress>> resolveAll​(String inetHost,
                                                                                    Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
        Resolves the specified host name and port into a list of address.
        Parameters:
        inetHost - the name to resolve
        additionals - additional records (OPT)
        Returns:
        the list of the address as the result of the resolution
      • resolveAll

        public final io.netty5.util.concurrent.Future<List<InetAddress>> resolveAll​(String inetHost,
                                                                                    Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals,
                                                                                    io.netty5.util.concurrent.Promise<List<InetAddress>> promise)
        Resolves the specified host name and port into a list of address.
        Parameters:
        inetHost - the name to resolve
        additionals - additional records (OPT)
        promise - the Promise which will be fulfilled when the name resolution is finished
        Returns:
        the list of the address as the result of the resolution
      • doResolve

        protected void doResolve​(String inetHost,
                                 io.netty5.util.concurrent.Promise<InetAddress> promise)
                          throws Exception
        Specified by:
        doResolve in class io.netty5.resolver.SimpleNameResolver<InetAddress>
        Throws:
        Exception
      • resolveAll

        public final io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question)
        Resolves the DnsRecords that are matched by the specified DnsQuestion. Unlike query(DnsQuestion), this method handles redirection, CNAMEs and multiple name servers. If the specified DnsQuestion is A or AAAA, this method looks up the configured HostsFileEntries before sending a query to the name servers. If a match is found in the HostsFileEntries, a synthetic A or AAAA record will be returned.
        Parameters:
        question - the question
        Returns:
        the list of the DnsRecords as the result of the resolution
      • resolveAll

        public final io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                              Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
        Resolves the DnsRecords that are matched by the specified DnsQuestion. Unlike query(DnsQuestion), this method handles redirection, CNAMEs and multiple name servers. If the specified DnsQuestion is A or AAAA, this method looks up the configured HostsFileEntries before sending a query to the name servers. If a match is found in the HostsFileEntries, a synthetic A or AAAA record will be returned.
        Parameters:
        question - the question
        additionals - additional records (OPT)
        Returns:
        the list of the DnsRecords as the result of the resolution
      • resolveAll

        public final io.netty5.util.concurrent.Future<List<io.netty5.handler.codec.dns.DnsRecord>> resolveAll​(io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                              Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals,
                                                                                                              io.netty5.util.concurrent.Promise<List<io.netty5.handler.codec.dns.DnsRecord>> promise)
        Resolves the DnsRecords that are matched by the specified DnsQuestion. Unlike query(DnsQuestion), this method handles redirection, CNAMEs and multiple name servers. If the specified DnsQuestion is A or AAAA, this method looks up the configured HostsFileEntries before sending a query to the name servers. If a match is found in the HostsFileEntries, a synthetic A or AAAA record will be returned.
        Parameters:
        question - the question
        additionals - additional records (OPT)
        promise - the Promise which will be fulfilled when the resolution is finished
        Returns:
        the list of the DnsRecords as the result of the resolution
      • doResolve

        protected void doResolve​(String inetHost,
                                 io.netty5.handler.codec.dns.DnsRecord[] additionals,
                                 io.netty5.util.concurrent.Promise<InetAddress> promise,
                                 DnsCache resolveCache)
                          throws Exception
        Hook designed for extensibility so one can pass a different cache on each resolution attempt instead of using the global one.
        Throws:
        Exception
      • doResolveAll

        protected void doResolveAll​(String inetHost,
                                    io.netty5.util.concurrent.Promise<List<InetAddress>> promise)
                             throws Exception
        Specified by:
        doResolveAll in class io.netty5.resolver.SimpleNameResolver<InetAddress>
        Throws:
        Exception
      • doResolveAll

        protected void doResolveAll​(String inetHost,
                                    io.netty5.handler.codec.dns.DnsRecord[] additionals,
                                    io.netty5.util.concurrent.Promise<List<InetAddress>> promise,
                                    DnsCache resolveCache)
                             throws Exception
        Hook designed for extensibility so one can pass a different cache on each resolution attempt instead of using the global one.
        Throws:
        Exception
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question)
        Sends a DNS query with the specified question.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                                                                            Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
        Sends a DNS query with the specified question with additional records.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                                                                            io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
        Sends a DNS query with the specified question.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr,
                                                                                                                                                            io.netty5.handler.codec.dns.DnsQuestion question)
        Sends a DNS query with the specified question using the specified name server list.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr,
                                                                                                                                                            io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                                                                            Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals)
        Sends a DNS query with the specified question with additional records using the specified name server list.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr,
                                                                                                                                                            io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                                                                            io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
        Sends a DNS query with the specified question using the specified name server list.
      • query

        public io.netty5.util.concurrent.Future<io.netty5.channel.AddressedEnvelope<io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> query​(InetSocketAddress nameServerAddr,
                                                                                                                                                            io.netty5.handler.codec.dns.DnsQuestion question,
                                                                                                                                                            Iterable<io.netty5.handler.codec.dns.DnsRecord> additionals,
                                                                                                                                                            io.netty5.util.concurrent.Promise<io.netty5.channel.AddressedEnvelope<? extends io.netty5.handler.codec.dns.DnsResponse,​InetSocketAddress>> promise)
        Sends a DNS query with the specified question with additional records using the specified name server list.
      • isTransportOrTimeoutError

        public static boolean isTransportOrTimeoutError​(Throwable cause)
        Returns true if the Throwable was caused by an timeout or transport error. These methods can be used on the AsynchronousResult.cause() that is returned by the various methods exposed by this DnsNameResolver.
      • isTimeoutError

        public static boolean isTimeoutError​(Throwable cause)
        Returns true if the Throwable was caused by an timeout. These methods can be used on the AsynchronousResult.cause() that is returned by the various methods exposed by this DnsNameResolver.