pub struct DnsClientConfig {
pub nameservers: Vec<SocketAddr>,
pub timeout: Duration,
pub attempts: u8,
pub rotate: bool,
pub pool_max_idle: u64,
}Expand description
Configuration for creating a new DnsClient instance.
Fields§
§nameservers: Vec<SocketAddr>One or more DNS nameservers to use for resolution. These servers will be tried
in order for each resolution unless rotate is set.
timeout: DurationTimeout for each resolution. This timeout is applied to each attempt and so a
single call to DnsClient::resolve may take longer based on the value of attempts.
attempts: u8Number of attempts to make performing a resolution for a single name. Note that any response from a DNS server counts as “success”. Only timeout or network errors will trigger retries.
rotate: boolIf true, nameservers will be round-robin load balanced for each resolution. If false
the nameservers are tried in-order for each resolution.
pool_max_idle: u64Max number of open sockets or connections to each nameserver. Default is to keep one open socket or connection per nameserver. Set to 0 to disable this behavior.
Trait Implementations§
Source§impl Clone for DnsClientConfig
impl Clone for DnsClientConfig
Source§fn clone(&self) -> DnsClientConfig
fn clone(&self) -> DnsClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more