Package org.minidns.iterative
Class ReliableDnsClient
- java.lang.Object
-
- org.minidns.AbstractDnsClient
-
- org.minidns.iterative.ReliableDnsClient
-
public class ReliableDnsClient extends org.minidns.AbstractDnsClientA 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 Classes Modifier and Type Class Description static classReliableDnsClient.Mode
-
Constructor Summary
Constructors Constructor Description ReliableDnsClient()ReliableDnsClient(org.minidns.DnsCache dnsCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.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)voidsetMode(ReliableDnsClient.Mode mode)Set 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
-
-
-
-
Method Detail
-
query
protected org.minidns.dnsqueryresult.DnsQueryResult query(org.minidns.dnsmessage.DnsMessage.Builder q) throws java.io.IOException- Specified by:
queryin classorg.minidns.AbstractDnsClient- Throws:
java.io.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
protected java.lang.String isResponseAcceptable(org.minidns.dnsmessage.DnsMessage response)
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
public void setMode(ReliableDnsClient.Mode mode)
Set the mode used when resolving queries.- Parameters:
mode- the mode to use.
-
setUseHardcodedDnsServers
public void setUseHardcodedDnsServers(boolean useHardcodedDnsServers)
-
-