Package org.minidns.iterative
Class ReliableDnsClient
java.lang.Object
org.minidns.AbstractDnsClient
org.minidns.iterative.ReliableDnsClient
public class ReliableDnsClient
extends org.minidns.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.
-
Nested Class Summary
Nested ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected StringisResponseAcceptable(org.minidns.dnsmessage.DnsMessage response) Check if the response from the system's nameserver is acceptable.protected booleanisResponseCacheable(org.minidns.dnsmessage.Question q, org.minidns.dnsqueryresult.DnsQueryResult result) protected org.minidns.dnsmessage.DnsMessage.BuildernewQuestion(org.minidns.dnsmessage.DnsMessage.Builder questionMessage) protected org.minidns.dnsqueryresult.DnsQueryResultquery(org.minidns.dnsmessage.DnsMessage.Builder q) voidsetDataSource(org.minidns.source.DnsDataSource dataSource) voidSet the mode used when resolving queries.voidsetUseHardcodedDnsServers(boolean useHardcodedDnsServers) 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, setDefaultIpVersion, setPreferedIpVersion
-
Constructor Details
-
ReliableDnsClient
public ReliableDnsClient(org.minidns.DnsCache dnsCache) -
ReliableDnsClient
public ReliableDnsClient()
-
-
Method Details
-
query
protected org.minidns.dnsqueryresult.DnsQueryResult query(org.minidns.dnsmessage.DnsMessage.Builder q) throws IOException - Specified by:
queryin classorg.minidns.AbstractDnsClient- Throws:
IOException
-
newQuestion
protected org.minidns.dnsmessage.DnsMessage.Builder newQuestion(org.minidns.dnsmessage.DnsMessage.Builder questionMessage) - Specified by:
newQuestionin classorg.minidns.AbstractDnsClient
-
isResponseCacheable
protected boolean isResponseCacheable(org.minidns.dnsmessage.Question q, org.minidns.dnsqueryresult.DnsQueryResult result) - Overrides:
isResponseCacheablein classorg.minidns.AbstractDnsClient
-
isResponseAcceptable
Check if the response from the system's nameserver is acceptable. Must returnnullif the response is acceptable, or a String describing why it is not acceptable. If the response is not acceptable thenReliableDnsClientwill fall back to resolve the query iteratively.- Parameters:
response- the response we got from the system's nameserver.- Returns:
nullif the response is acceptable, or a String if not.
-
setDataSource
public void setDataSource(org.minidns.source.DnsDataSource dataSource) - Overrides:
setDataSourcein classorg.minidns.AbstractDnsClient
-
setMode
Set the mode used when resolving queries.- Parameters:
mode- the mode to use.
-
setUseHardcodedDnsServers
public void setUseHardcodedDnsServers(boolean useHardcodedDnsServers)
-