add DNS configuration for TCP fallback.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
b6cf0e6fcf
commit
8b003e6be2
3 changed files with 7 additions and 0 deletions
|
@ -491,6 +491,9 @@ allow_profile_lookup_federation_requests = true
|
|||
# Number of retries after a timeout.
|
||||
#dns_attempts = 5
|
||||
|
||||
# Fallback to TCP on DNS errors. Set this to false if unsupported by nameserver.
|
||||
#dns_tcp_fallback = true
|
||||
|
||||
# Enable to query all nameservers until the domain is found. Referred to as "trust_negative_responses" in hickory_resolver.
|
||||
# This can avoid useless DNS queries if the first nameserver responds with NXDOMAIN or an empty NOERROR response.
|
||||
#
|
||||
|
|
|
@ -98,6 +98,8 @@ pub struct Config {
|
|||
pub dns_attempts: u16,
|
||||
#[serde(default = "default_dns_timeout")]
|
||||
pub dns_timeout: u64,
|
||||
#[serde(default = "true_fn")]
|
||||
pub dns_tcp_fallback: bool,
|
||||
#[serde(default)]
|
||||
pub query_all_nameservers: bool,
|
||||
#[serde(default = "default_max_request_size")]
|
||||
|
@ -494,6 +496,7 @@ impl fmt::Display for Config {
|
|||
("DNS minimum nxdomain ttl", &self.dns_min_ttl_nxdomain.to_string()),
|
||||
("DNS attempts", &self.dns_attempts.to_string()),
|
||||
("DNS timeout", &self.dns_timeout.to_string()),
|
||||
("DNS fallback to TCP", &self.dns_tcp_fallback.to_string()),
|
||||
("Query all nameservers", &self.query_all_nameservers.to_string()),
|
||||
("Maximum request size (bytes)", &self.max_request_size.to_string()),
|
||||
("Maximum concurrent requests", &self.max_concurrent_requests.to_string()),
|
||||
|
|
|
@ -64,6 +64,7 @@ impl Resolver {
|
|||
opts.positive_max_ttl = Some(Duration::from_secs(60 * 60 * 24 * 7));
|
||||
opts.timeout = Duration::from_secs(config.dns_timeout);
|
||||
opts.attempts = config.dns_attempts as usize;
|
||||
opts.try_tcp_on_error = config.dns_tcp_fallback;
|
||||
opts.num_concurrent_reqs = 1;
|
||||
opts.shuffle_dns_servers = true;
|
||||
opts.rotate = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue