Package org.microproxy.dns
Class DnssecHostResolver
java.lang.Object
org.microproxy.dns.DnssecHostResolver
- All Implemented Interfaces:
HostResolver
A
HostResolver that validates answers with DNSSEC, the replacement for LittleProxy's
dnssec4j-based DnsSecServerResolver.
Queries go to a recursive resolver (by default those in /etc/resolv.conf) with the DO
and CD bits set; every answer is validated locally against the root zone trust anchors (KSK-2017
and KSK-2024). With the default DnssecHostResolver.Policy.REJECT_BOGUS, names in signed zones resolve only
with valid signatures, names in provably unsigned zones resolve normally, and anything else
fails with DnssecValidationException. Network failures also fail resolution: there is
no silent fallback to unvalidated lookups.
IP literals and localhost are returned without a lookup. Answers, zone keys and
delegation facts are cached for their TTL, up to an hour.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfigures aDnssecHostResolver.static enumWhat to accept.static final recordThe result of a lookup. -
Field Summary
FieldsModifier and TypeFieldDescriptionIANA root zone trust anchors (https://data.iana.org/root-anchors/root-anchors.xml). -
Constructor Summary
ConstructorsConstructorDescriptionUses the system's resolvers, the IANA root anchors andDnssecHostResolver.Policy.REJECT_BOGUS. -
Method Summary
Modifier and TypeMethodDescriptionstatic DnssecHostResolver.Builderbuilder()Starts a builder with the default settings.Resolveshostto its IPv4 addresses, or IPv6 addresses if it has none.Resolves a host name and associates it with the requested port.
-
Field Details
-
ROOT_TRUST_ANCHORS
IANA root zone trust anchors (https://data.iana.org/root-anchors/root-anchors.xml).
-
-
Constructor Details
-
DnssecHostResolver
public DnssecHostResolver()Uses the system's resolvers, the IANA root anchors andDnssecHostResolver.Policy.REJECT_BOGUS.
-
-
Method Details
-
builder
Starts a builder with the default settings.- Returns:
- a new builder with default settings
-
resolve
Description copied from interface:HostResolverResolves a host name and associates it with the requested port.- Specified by:
resolvein interfaceHostResolver- Parameters:
host- the destination host nameport- the destination port- Returns:
- the resolved destination socket address
- Throws:
UnknownHostException- if the host cannot be resolved
-
lookup
Resolveshostto its IPv4 addresses, or IPv6 addresses if it has none.- Parameters:
host- the destination host name- Returns:
- the resolved addresses and their DNSSEC security state
- Throws:
DnssecValidationException- if the answer is bogus, or insecure underDnssecHostResolver.Policy.REQUIRE_SECUREUnknownHostException- if the name does not exist or DNS cannot be reached
-