Package org.minidns.iterative
Class ReliableDnsClient
java.lang.Object
org.minidns.AbstractDnsClient
org.minidns.iterative.ReliableDnsClient
- Direct Known Subclasses:
 DnssecClient
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
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(DnsMessage response) Check if the response from the system's nameserver is acceptable.protected booleanisResponseCacheable(Question q, DnsQueryResult result) Whether a response from the DNS system should be cached or not.protected DnsMessage.BuildernewQuestion(DnsMessage.Builder questionMessage) protected DnsQueryResultSend a query request to the DNS system.voidsetDataSource(DnsDataSource dataSource) Set aDnsDataSourceto be used by the DnsClient.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
 - 
ReliableDnsClient
public ReliableDnsClient() 
 - 
 - 
Method Details
- 
query
Description copied from class:AbstractDnsClientSend a query request to the DNS system.- Specified by:
 queryin classAbstractDnsClient- Parameters:
 q- The query to send to the server.- Returns:
 - The response (or null).
 - Throws:
 IOException- if an IO error occurs.
 - 
newQuestion
- Specified by:
 newQuestionin classAbstractDnsClient
 - 
isResponseCacheable
Description copied from class:AbstractDnsClientWhether a response from the DNS system should be cached or not.- Overrides:
 isResponseCacheablein classAbstractDnsClient- Parameters:
 q- The question the response message should answer.result- The DNS query result.- Returns:
 - True, if the response should be cached, false otherwise.
 
 - 
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
Description copied from class:AbstractDnsClientSet aDnsDataSourceto 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:
 setDataSourcein classAbstractDnsClient- Parameters:
 dataSource- An implementation of DNSDataSource that shall be used.
 - 
setMode
Set the mode used when resolving queries.- Parameters:
 mode- the mode to use.
 - 
setUseHardcodedDnsServers
 
 -