Class IterativeDnsClient

java.lang.Object
org.minidns.AbstractDnsClient
org.minidns.iterative.IterativeDnsClient

public class IterativeDnsClient extends org.minidns.AbstractDnsClient
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.minidns.AbstractDnsClient

    org.minidns.AbstractDnsClient.IpVersionSetting
  • Field Summary

    Fields inherited from class org.minidns.AbstractDnsClient

    cache, dataSource, DEFAULT_CACHE, DEFAULT_IP_VERSION_SETTING, insecureRandom, ipVersionSetting, LOGGER, random
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new recursive DNS client using the global default cache.
    IterativeDnsClient(org.minidns.DnsCache cache)
    Create a new recursive DNS client with the given DNS cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static void
     
    getRootServer(char rootServerId)
     
    getRootServer(char rootServerId, org.minidns.AbstractDnsClient.IpVersionSetting setting)
     
    protected boolean
    isResponseCacheable(org.minidns.dnsmessage.Question q, org.minidns.dnsqueryresult.DnsQueryResult result)
     
    protected org.minidns.dnsmessage.DnsMessage.Builder
    newQuestion(org.minidns.dnsmessage.DnsMessage.Builder message)
     
    protected org.minidns.dnsqueryresult.DnsQueryResult
    query(org.minidns.dnsmessage.DnsMessage.Builder queryBuilder)
    Recursively query the DNS system for one entry.

    Methods inherited from class org.minidns.AbstractDnsClient

    getCache, getCachedIPv4AddressesFor, getCachedIPv4NameserverAddressesFor, getCachedIPv6AddressesFor, getCachedIPv6NameserverAddressesFor, getCachedNameserverRecordsFor, getDataSource, getPreferedIpVersion, getQueryFor, query, query, query, query, query, query, query, query, query, query, query, queryAsync, queryAsync, queryAsync, queryAsync, queryAsync, setDataSource, setDefaultIpVersion, setPreferedIpVersion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IterativeDnsClient

      public IterativeDnsClient()
      Create a new recursive DNS client using the global default cache.
    • IterativeDnsClient

      public IterativeDnsClient(org.minidns.DnsCache cache)
      Create a new recursive DNS client with the given DNS cache.
      Parameters:
      cache - The backend DNS cache.
  • Method Details

    • query

      protected org.minidns.dnsqueryresult.DnsQueryResult query(org.minidns.dnsmessage.DnsMessage.Builder queryBuilder) throws IOException
      Recursively query the DNS system for one entry.
      Specified by:
      query in class org.minidns.AbstractDnsClient
      Parameters:
      queryBuilder - The query DNS message builder.
      Returns:
      The response (or null on timeout/error).
      Throws:
      IOException - if an IO error occurs.
    • getRootServer

      public static List<InetAddress> getRootServer(char rootServerId)
    • getRootServer

      public static List<InetAddress> getRootServer(char rootServerId, org.minidns.AbstractDnsClient.IpVersionSetting setting)
    • isResponseCacheable

      protected boolean isResponseCacheable(org.minidns.dnsmessage.Question q, org.minidns.dnsqueryresult.DnsQueryResult result)
      Overrides:
      isResponseCacheable in class org.minidns.AbstractDnsClient
    • newQuestion

      protected org.minidns.dnsmessage.DnsMessage.Builder newQuestion(org.minidns.dnsmessage.DnsMessage.Builder message)
      Specified by:
      newQuestion in class org.minidns.AbstractDnsClient
    • abortIfFatal

      protected static void abortIfFatal(IOException ioException) throws IOException
      Throws:
      IOException