DnsResolver
DnsResolver
Section titled “DnsResolver”Configures the DNS resolver used for domain lookups.
This object can be configured from the WebUI under Settings › Network › DNS › DNS Resolver
Fields
Section titled “Fields”DnsResolver is a multi-variant object: each instance has an @type discriminator selecting one of the variants below, and each variant carries its own set of fields.
@type: "System"
Section titled “@type: "System"”System Resolver
attempts
Section titled “attempts”Type:
UnsignedInt· default:2Number of times a resolution request will be retried before it is considered failed
concurrency
Section titled “concurrency”Type:
UnsignedInt· default:2Number of concurrent resolution requests that can be made at the same time
enableEdns
Section titled “enableEdns”Type:
Boolean· default:trueWhether to enable EDNS (Extension Mechanisms for DNS) support
preserveIntermediates
Section titled “preserveIntermediates”Type:
Boolean· default:trueWhether to preserve the intermediate name servers in the DNS resolution results
timeout
Section titled “timeout”Type:
Duration· default:"5s"Time after which a resolution request will be timed out if no response is received
tcpOnError
Section titled “tcpOnError”Type:
Boolean· default:trueWhether to try using TCP for resolution requests if an error occurs during a UDP resolution request
@type: "Custom"
Section titled “@type: "Custom"”Custom DNS
servers
Section titled “servers”Type:
DnsCustomResolver[]· min items: 1List of custom DNS server URLs to use for resolution
attempts
Section titled “attempts”Type:
UnsignedInt· default:2Number of times a resolution request will be retried before it is considered failed
concurrency
Section titled “concurrency”Type:
UnsignedInt· default:2Number of concurrent resolution requests that can be made at the same time
enableEdns
Section titled “enableEdns”Type:
Boolean· default:trueWhether to enable EDNS (Extension Mechanisms for DNS) support
preserveIntermediates
Section titled “preserveIntermediates”Type:
Boolean· default:trueWhether to preserve the intermediate name servers in the DNS resolution results
timeout
Section titled “timeout”Type:
Duration· default:"5s"Time after which a resolution request will be timed out if no response is received
tcpOnError
Section titled “tcpOnError”Type:
Boolean· default:trueWhether to try using TCP for resolution requests if an error occurs during a UDP resolution request
@type: "Cloudflare"
Section titled “@type: "Cloudflare"”Cloudflare DNS
useTls
Section titled “useTls”Type:
Boolean· default:trueWhether to use TLS for DNS resolution
attempts
Section titled “attempts”Type:
UnsignedInt· default:2Number of times a resolution request will be retried before it is considered failed
concurrency
Section titled “concurrency”Type:
UnsignedInt· default:2Number of concurrent resolution requests that can be made at the same time
enableEdns
Section titled “enableEdns”Type:
Boolean· default:trueWhether to enable EDNS (Extension Mechanisms for DNS) support
preserveIntermediates
Section titled “preserveIntermediates”Type:
Boolean· default:trueWhether to preserve the intermediate name servers in the DNS resolution results
timeout
Section titled “timeout”Type:
Duration· default:"5s"Time after which a resolution request will be timed out if no response is received
tcpOnError
Section titled “tcpOnError”Type:
Boolean· default:trueWhether to try using TCP for resolution requests if an error occurs during a UDP resolution request
@type: "Quad9"
Section titled “@type: "Quad9"”Quad9 DNS
useTls
Section titled “useTls”Type:
Boolean· default:trueWhether to use TLS for DNS resolution
attempts
Section titled “attempts”Type:
UnsignedInt· default:2Number of times a resolution request will be retried before it is considered failed
concurrency
Section titled “concurrency”Type:
UnsignedInt· default:2Number of concurrent resolution requests that can be made at the same time
enableEdns
Section titled “enableEdns”Type:
Boolean· default:trueWhether to enable EDNS (Extension Mechanisms for DNS) support
preserveIntermediates
Section titled “preserveIntermediates”Type:
Boolean· default:trueWhether to preserve the intermediate name servers in the DNS resolution results
timeout
Section titled “timeout”Type:
Duration· default:"5s"Time after which a resolution request will be timed out if no response is received
tcpOnError
Section titled “tcpOnError”Type:
Boolean· default:trueWhether to try using TCP for resolution requests if an error occurs during a UDP resolution request
@type: "Google"
Section titled “@type: "Google"”Google DNS
attempts
Section titled “attempts”Type:
UnsignedInt· default:2Number of times a resolution request will be retried before it is considered failed
concurrency
Section titled “concurrency”Type:
UnsignedInt· default:2Number of concurrent resolution requests that can be made at the same time
enableEdns
Section titled “enableEdns”Type:
Boolean· default:trueWhether to enable EDNS (Extension Mechanisms for DNS) support
preserveIntermediates
Section titled “preserveIntermediates”Type:
Boolean· default:trueWhether to preserve the intermediate name servers in the DNS resolution results
timeout
Section titled “timeout”Type:
Duration· default:"5s"Time after which a resolution request will be timed out if no response is received
tcpOnError
Section titled “tcpOnError”Type:
Boolean· default:trueWhether to try using TCP for resolution requests if an error occurs during a UDP resolution request
JMAP API
Section titled “JMAP API”The DnsResolver singleton is available via the urn:stalwart:jmap capability.
x:DnsResolver/get
Section titled “x:DnsResolver/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
For singletons, the ids argument should be the literal singleton (or null to return the single instance).
This method requires the sysDnsResolverGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:DnsResolver/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:DnsResolver/set
Section titled “x:DnsResolver/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.
This method requires the sysDnsResolverUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:DnsResolver/set", { "update": { "singleton": { "attempts": 2 } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get DnsResolverUpdate
Section titled “Update”stalwart-cli update DnsResolver --field attempts=2Nested types
Section titled “Nested types”DnsCustomResolver
Section titled “DnsCustomResolver”Custom DNS server endpoint.
protocol
Section titled “protocol”Type:
DnsResolverProtocol· default:"udp"Protocol to use for DNS queries
address
Section titled “address”Type:
IpAddr· default:"127.0.0.1"Address of the DNS server
Type:
UnsignedInt· default:53· min: 1 · max: 65535Port of the DNS server
DnsResolverProtocol
Section titled “DnsResolverProtocol”| Value | Label |
|---|---|
tls | DNS over TLS |
udp | UDP |
tcp | TCP |