public class DnssecClient extends ReliableDnsClient
ReliableDnsClient.Mode
AbstractDnsClient.IpVersionSetting
cache, dataSource, DEFAULT_CACHE, DEFAULT_IP_VERSION_SETTING, insecureRandom, ipVersionSetting, LOGGER, random
Constructor and Description |
---|
DnssecClient()
Create a new DNSSEC aware DNS client using the global default cache.
|
DnssecClient(DnsCache cache)
Create a new DNSSEC aware DNS client with the given DNS cache.
|
Modifier and Type | Method and Description |
---|---|
void |
addSecureEntryPoint(DnsName name,
byte[] key)
Add a new secure entry point to the list of known secure entry points.
|
void |
clearSecureEntryPoints()
Clears the list of known secure entry points.
|
void |
configureLookasideValidation(DnsName dlv)
Enables DNSSEC Lookaside Validation (DLV) using the given DLV service.
|
void |
disableLookasideValidation()
Disables DNSSEC Lookaside Validation (DLV).
|
void |
enableLookasideValidation()
Enables DNSSEC Lookaside Validation (DLV) using the default DLV service at dlv.isc.org.
|
protected String |
isResponseAcceptable(DnsMessage response)
Check if the response from the system's nameserver is acceptable.
|
protected boolean |
isResponseCacheable(Question q,
DnsMessage dnsMessage)
Whether a response from the DNS system should be cached or not.
|
boolean |
isStripSignatureRecords()
Whether signature records (RRSIG) are stripped from the resulting
DnsMessage . |
protected DnsMessage.Builder |
newQuestion(DnsMessage.Builder message) |
DnsMessage |
query(Question q) |
DnssecMessage |
queryDnssec(CharSequence name,
Record.TYPE type) |
DnssecMessage |
queryDnssec(Question q) |
void |
removeSecureEntryPoint(DnsName name)
Remove the secure entry point stored for a domain name.
|
void |
setStripSignatureRecords(boolean stripSignatureRecords)
Enable or disable stripping of signature records (RRSIG) from the result
DnsMessage . |
query, setDataSource, setMode
getCache, getCachedIPv4AddressesFor, getCachedIPv4NameserverAddressesFor, getCachedIPv6AddressesFor, getCachedIPv6NameserverAddressesFor, getCachedNameserverRecordsFor, getDataSource, getPreferedIpVersion, getQueryFor, query, query, query, query, query, query, query, query, query, query, queryAsync, queryAsync, queryAsync, queryAsync, queryAsync, setDefaultIpVersion, setPreferedIpVersion
public DnssecClient()
public DnssecClient(DnsCache cache)
cache
- The backend DNS cache.public DnsMessage query(Question q) throws IOException
query
in class AbstractDnsClient
IOException
public DnssecMessage queryDnssec(CharSequence name, Record.TYPE type) throws IOException
IOException
public DnssecMessage queryDnssec(Question q) throws IOException
IOException
protected boolean isResponseCacheable(Question q, DnsMessage dnsMessage)
AbstractDnsClient
isResponseCacheable
in class ReliableDnsClient
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 ReliableDnsClient
protected String isResponseAcceptable(DnsMessage response)
ReliableDnsClient
null
if the response
is acceptable, or a String describing why it is not acceptable. If the response is not acceptable then
ReliableDnsClient
will fall back to resolve the query iteratively.isResponseAcceptable
in class ReliableDnsClient
response
- the response we got from the system's nameserver.null
if the response is acceptable, or a String if not.public void addSecureEntryPoint(DnsName name, byte[] key)
name
- The domain name originating the key. Once the secure entry point for this domain is requested,
the resolver will use this key without further verification instead of using the DNS system to
verify the key.key
- The secure entry point corresponding to the domain name. This key can be retrieved by requesting
the DNSKEY record for the domain and using the key with first flags bit set
(also called key signing key)public void removeSecureEntryPoint(DnsName name)
name
- The domain name of which the corresponding secure entry point shall be removed. For the root zone,
use the empty string here.public void clearSecureEntryPoints()
public boolean isStripSignatureRecords()
DnsMessage
.
Default is true
.public void setStripSignatureRecords(boolean stripSignatureRecords)
DnsMessage
.stripSignatureRecords
- Whether signature records shall be stripped.public void enableLookasideValidation()
public void disableLookasideValidation()
enableLookasideValidation()
was used before.public void configureLookasideValidation(DnsName dlv)
dlv
- The domain name of the DLV service to be used or null
to disable DLV.