public class IterativeDnsClient extends AbstractDnsClient
AbstractDnsClient.IpVersionSetting
Modifier and Type | Field and Description |
---|---|
protected static Inet4Address[] |
IPV4_ROOT_SERVERS |
protected static Inet6Address[] |
IPV6_ROOT_SERVERS |
cache, dataSource, DEFAULT_CACHE, DEFAULT_IP_VERSION_SETTING, insecureRandom, ipVersionSetting, LOGGER, random
Constructor and Description |
---|
IterativeDnsClient()
Create a new recursive DNS client using the global default cache.
|
IterativeDnsClient(DnsCache cache)
Create a new recursive DNS client with the given DNS cache.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
abortIfFatal(IOException ioException) |
static List<InetAddress> |
getRootServer(char rootServerId) |
static List<InetAddress> |
getRootServer(char rootServerId,
AbstractDnsClient.IpVersionSetting setting) |
protected boolean |
isResponseCacheable(Question q,
DnsMessage dnsMessage)
Whether a response from the DNS system should be cached or not.
|
protected DnsMessage.Builder |
newQuestion(DnsMessage.Builder message) |
protected DnsMessage |
query(DnsMessage.Builder queryBuilder)
Recursively query the DNS system for one entry.
|
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
protected static final Inet4Address[] IPV4_ROOT_SERVERS
protected static final Inet6Address[] IPV6_ROOT_SERVERS
public IterativeDnsClient()
public IterativeDnsClient(DnsCache cache)
cache
- The backend DNS cache.protected DnsMessage query(DnsMessage.Builder queryBuilder) throws IOException
query
in class AbstractDnsClient
queryBuilder
- The query DNS message builder.IOException
- if an IO error occurs.public static List<InetAddress> getRootServer(char rootServerId)
public static List<InetAddress> getRootServer(char rootServerId, AbstractDnsClient.IpVersionSetting setting)
protected boolean isResponseCacheable(Question q, DnsMessage dnsMessage)
AbstractDnsClient
isResponseCacheable
in class AbstractDnsClient
q
- The question the response message should answer.dnsMessage
- The response message received using the DNS client.protected DnsMessage.Builder newQuestion(DnsMessage.Builder message)
newQuestion
in class AbstractDnsClient
protected static void abortIfFatal(IOException ioException) throws IOException
IOException