Package org.microproxy.dns
Class DnssecHostResolver.Builder
java.lang.Object
org.microproxy.dns.DnssecHostResolver.Builder
- Enclosing class:
DnssecHostResolver
Configures a
DnssecHostResolver.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates the configured validating DNS resolver.cacheCapacity(int entries) Maximum entries in each of the answer, zone-key, unsigned-delegation and non-delegation caches (default 1024 each).The clock used for signature validity and caching.maxValidationWork(int units) Caps aggregate DNSSEC work per lookup, including aliases, delegation proofs and A/AAAA fallback.policy(DnssecHostResolver.Policy policy) Sets the policy for accepting insecure DNS responses.Where to send queries, as a DNS-over-HTTPS URL (https://cloudflare-dns.com/dns-query) or a comma-separated list of resolver addresses (9.9.9.9,149.112.112.112:53).servers(List<InetSocketAddress> servers) Recursive resolvers to query; they must pass DNSSEC records through.Per-attempt UDP/TCP timeout.transport(DnsTransport transport) A custom transport (e.g.trustAnchors(List<String> dsRecords) Root DS records in the form". 20326 8 2 E06D..."; defaults to the IANA anchors.
-
Method Details
-
maxValidationWork
Caps aggregate DNSSEC work per lookup, including aliases, delegation proofs and A/AAAA fallback. A signature/key conversion costs 128 units, a DS digest 8, and each NSEC3 SHA-1 round 1. The default 8192 allows fewer than 64 signatures in a cold signed chain. Exhaustion rejects the lookup regardless ofDnssecHostResolver.Policy.- Parameters:
units- positive work allowance- Returns:
- this builder
-
cacheCapacity
Maximum entries in each of the answer, zone-key, unsigned-delegation and non-delegation caches (default 1024 each). Expired entries are evicted on cache activity; zero disables retention. Eviction only causes revalidation and never changes the security policy.- Parameters:
entries- nonnegative per-cache entry limit- Returns:
- this builder
-
servers
Recursive resolvers to query; they must pass DNSSEC records through.- Parameters:
servers- the recursive DNS server addresses- Returns:
- this builder
-
resolver
Where to send queries, as a DNS-over-HTTPS URL (https://cloudflare-dns.com/dns-query) or a comma-separated list of resolver addresses (9.9.9.9,149.112.112.112:53).- Parameters:
spec- the resolver URL or comma-separated resolver addresses- Returns:
- this builder
-
transport
A custom transport (e.g. DNS over HTTPS); overridesservers.- Parameters:
transport- the DNS query transport- Returns:
- this builder
-
timeout
Per-attempt UDP/TCP timeout.- Parameters:
timeout- the per-attempt UDP/TCP query timeout- Returns:
- this builder
-
policy
Sets the policy for accepting insecure DNS responses.- Parameters:
policy- the policy for accepting DNS answers without a secure chain- Returns:
- this builder
-
trustAnchors
Root DS records in the form". 20326 8 2 E06D..."; defaults to the IANA anchors.- Parameters:
dsRecords- the root DS trust-anchor records- Returns:
- this builder
-
clock
The clock used for signature validity and caching.- Parameters:
clock- the clock used for timestamps and expiry checks- Returns:
- this builder
-
build
Creates the configured validating DNS resolver.- Returns:
- the configured validating DNS resolver
-