Package org.xbill.DNS.dnssec
Class ValidatingResolver
java.lang.Object
org.xbill.DNS.dnssec.ValidatingResolver
- All Implemented Interfaces:
Resolver
This resolver validates responses with DNSSEC.
- Since:
- 3.5
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name from where the trust anchors are loaded.static final intThe QCLASS being used for the injection of the reason why the validator came to the returned result. -
Constructor Summary
ConstructorsConstructorDescriptionValidatingResolver(Resolver headResolver) Creates a new instance of this class.ValidatingResolver(Resolver headResolver, Clock clock) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionGets the amount of time to wait for a response before giving up.Gets the store with the loaded trust anchors.voidinit(Properties config) Initialize the module.booleanIftrue, an additional record with the validation reason is added to theSection.ADDITIONALsection.voidloadTrustAnchors(InputStream data) Load the trust anchor file into the trust anchor store.Asynchronously sends a message and validates the response with DNSSEC before returning it.voidsetAddReasonToAdditional(boolean isAddReasonToAdditional) Iftrue, an additional record with the validation reason is added to theSection.ADDITIONALsection.voidsetEDNS(int version, int payloadSize, int flags, List<EDNSOption> options) The method is forwarded to the resolver, but always ensure that the level is 0 and the flags contains DO.voidsetIgnoreTruncation(boolean flag) This is a no-op, truncation is never ignored.voidsetPort(int port) Forwards the data to the head resolver passed at construction time.voidsetTCP(boolean flag) Forwards the data to the head resolver passed at construction time.voidsetTimeout(Duration duration) Sets the amount of time to wait for a response before giving up.voidsetTSIGKey(TSIG key) Forwards the data to the head resolver passed at construction time.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xbill.DNS.Resolver
send, sendAsync, sendAsync, setEDNS, setEDNS, setTimeout, setTimeout
-
Field Details
-
TRUST_ANCHOR_FILE_PROPERTY
Property name from where the trust anchors are loaded.- Since:
- 3.6
- See Also:
-
VALIDATION_REASON_QCLASS
public static final int VALIDATION_REASON_QCLASSThe QCLASS being used for the injection of the reason why the validator came to the returned result.- See Also:
-
-
Constructor Details
-
ValidatingResolver
Creates a new instance of this class.- Parameters:
headResolver- The resolver to which queries for DS, DNSKEY and referring CNAME records are sent.
-
ValidatingResolver
Creates a new instance of this class.- Parameters:
headResolver- The resolver to which queries for DS, DNSKEY and referring CNAME records are sent.clock- the Clock to validate messages.
-
-
Method Details
-
init
Initialize the module. Recognized configuration values:- "dnsjava.dnssec.trust_anchor_file"
- A filename from where to load the trust anchors
- Parameters:
config- The configuration data for this module.- Throws:
IOException- When the file specified in the config does not exist or cannot be read.- See Also:
-
loadTrustAnchors
Load the trust anchor file into the trust anchor store. The trust anchors are currently stored in a zone file format list of DNSKEY or DS records.- Parameters:
data- The trust anchor data.- Throws:
IOException- when the trust anchor data could not be read.
-
getTrustAnchors
Gets the store with the loaded trust anchors.- Returns:
- The store with the loaded trust anchors.
- Since:
- 3.6
-
setPort
public void setPort(int port) Forwards the data to the head resolver passed at construction time. -
setTCP
public void setTCP(boolean flag) Forwards the data to the head resolver passed at construction time. -
setIgnoreTruncation
public void setIgnoreTruncation(boolean flag) This is a no-op, truncation is never ignored.- Specified by:
setIgnoreTruncationin interfaceResolver- Parameters:
flag- unused
-
setEDNS
The method is forwarded to the resolver, but always ensure that the level is 0 and the flags contains DO.- Specified by:
setEDNSin interfaceResolver- Parameters:
version- The EDNS level to use. 0 indicates EDNS0.payloadSize- The maximum DNS packet size that this host is capable of receiving over UDP. If 0 is specified, the default (1280) is used.flags- EDNS extended flags to be set in the OPT record,ExtendedFlags.DOis always appended.options- EDNS options to be set in the OPT record, specified as a List of OPTRecord.Option elements.- See Also:
-
setTSIGKey
Forwards the data to the head resolver passed at construction time.- Specified by:
setTSIGKeyin interfaceResolver- Parameters:
key- The key.- See Also:
-
getTimeout
Description copied from interface:ResolverGets the amount of time to wait for a response before giving up.- Specified by:
getTimeoutin interfaceResolver- See Also:
-
setTimeout
Description copied from interface:ResolverSets the amount of time to wait for a response before giving up.- Specified by:
setTimeoutin interfaceResolver- Parameters:
duration- The amount of time to wait.
-
sendAsync
Asynchronously sends a message and validates the response with DNSSEC before returning it. -
isAddReasonToAdditional
public boolean isAddReasonToAdditional()Iftrue, an additional record with the validation reason is added to theSection.ADDITIONALsection. The record is available at./TXT/65280. -
setAddReasonToAdditional
public void setAddReasonToAdditional(boolean isAddReasonToAdditional) Iftrue, an additional record with the validation reason is added to theSection.ADDITIONALsection. The record is available at./TXT/65280.
-