Class ReliableDnsClient

  • Direct Known Subclasses:
    DnssecClient

    public class ReliableDnsClient
    extends AbstractDnsClient
    A DNS client using a reliable strategy. First the configured resolver of the system are used, then, in case there is no answer, a fall back to iterative resolving is performed.
    • Method Detail

      • isResponseAcceptable

        protected java.lang.String isResponseAcceptable​(DnsMessage response)
        Check if the response from the system's nameserver is acceptable. Must return null if the response is acceptable, or a String describing why it is not acceptable. If the response is not acceptable then ReliableDnsClient will fall back to resolve the query iteratively.
        Parameters:
        response - the response we got from the system's nameserver.
        Returns:
        null if the response is acceptable, or a String if not.
      • setDataSource

        public void setDataSource​(DnsDataSource dataSource)
        Description copied from class: AbstractDnsClient
        Set a DnsDataSource to be used by the DnsClient. The default implementation will direct all queries directly to the Internet. This can be used to define a non-default handling for outgoing data. This can be useful to redirect the requests to a proxy or to modify requests after or responses before they are handled by the DnsClient implementation.
        Overrides:
        setDataSource in class AbstractDnsClient
        Parameters:
        dataSource - An implementation of DNSDataSource that shall be used.