Struct hickory_resolver::config::ResolverOpts
source · #[non_exhaustive]pub struct ResolverOpts {Show 21 fields
pub ndots: usize,
pub timeout: Duration,
pub attempts: usize,
pub rotate: bool,
pub check_names: bool,
pub edns0: bool,
pub validate: bool,
pub ip_strategy: LookupIpStrategy,
pub cache_size: usize,
pub use_hosts_file: bool,
pub positive_min_ttl: Option<Duration>,
pub negative_min_ttl: Option<Duration>,
pub positive_max_ttl: Option<Duration>,
pub negative_max_ttl: Option<Duration>,
pub num_concurrent_reqs: usize,
pub preserve_intermediates: bool,
pub try_tcp_on_error: bool,
pub server_ordering_strategy: ServerOrderingStrategy,
pub recursion_desired: bool,
pub authentic_data: bool,
pub shuffle_dns_servers: bool,
}
Expand description
Configuration for the Resolver
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.ndots: usize
Sets the number of dots that must appear (unless it’s a final dot representing the root)
before a query is assumed to include the TLD. The default is one, which means that www
would never be assumed to be a TLD, and would always be appended to either the search
timeout: Duration
Specify the timeout for a request. Defaults to 5 seconds
attempts: usize
Number of retries after lookup failure before giving up. Defaults to 2
rotate: bool
Rotate through the resource records in the response (if there is more than one for a given name)
check_names: bool
Validate the names in the response, not implemented don’t really see the point unless you need to support badly configured DNS
edns0: bool
Enable edns, for larger records
validate: bool
Use DNSSEC to validate the request
ip_strategy: LookupIpStrategy
The ip_strategy for the Resolver to use when lookup Ipv4 or Ipv6 addresses
cache_size: usize
Cache size is in number of records (some records can be large)
use_hosts_file: bool
Check /ect/hosts file before dns requery (only works for unix like OS)
positive_min_ttl: Option<Duration>
Optional minimum TTL for positive responses.
If this is set, any positive responses with a TTL lower than this value will have a TTL of
positive_min_ttl
instead. Otherwise, this will default to 0 seconds.
negative_min_ttl: Option<Duration>
Optional minimum TTL for negative (NXDOMAIN
) responses.
If this is set, any negative responses with a TTL lower than this value will have a TTL of
negative_min_ttl
instead. Otherwise, this will default to 0 seconds.
positive_max_ttl: Option<Duration>
Optional maximum TTL for positive responses.
If this is set, any positive responses with a TTL higher than this value will have a TTL of
positive_max_ttl
instead. Otherwise, this will default to MAX_TTL
seconds.
negative_max_ttl: Option<Duration>
Optional maximum TTL for negative (NXDOMAIN
) responses.
If this is set, any negative responses with a TTL higher than this value will have a TTL of
negative_max_ttl
instead. Otherwise, this will default to MAX_TTL
seconds.
num_concurrent_reqs: usize
Number of concurrent requests per query
Where more than one nameserver is configured, this configures the resolver to send queries to a number of servers in parallel. Defaults to 2; 0 or 1 will execute requests serially.
preserve_intermediates: bool
Preserve all intermediate records in the lookup response, such as CNAME records
try_tcp_on_error: bool
Try queries over TCP if they fail over UDP.
server_ordering_strategy: ServerOrderingStrategy
The server ordering strategy that the resolver should use.
recursion_desired: bool
Request upstream recursive resolvers to not perform any recursion.
This is true by default, disabling this is useful for requesting single records, but may prevent successful resolution.
authentic_data: bool
This is true by default, disabling this is useful for requesting single records, but may prevent successful resolution.
shuffle_dns_servers: bool
Shuffle DNS servers before each query.
Trait Implementations§
source§impl Clone for ResolverOpts
impl Clone for ResolverOpts
source§fn clone(&self) -> ResolverOpts
fn clone(&self) -> ResolverOpts
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ResolverOpts
impl Debug for ResolverOpts
source§impl Default for ResolverOpts
impl Default for ResolverOpts
source§fn default() -> Self
fn default() -> Self
Default values for the Resolver configuration.
This follows the resolv.conf defaults as defined in the Linux man pages
source§impl<'de> Deserialize<'de> for ResolverOptswhere
ResolverOpts: Default,
impl<'de> Deserialize<'de> for ResolverOptswhere
ResolverOpts: Default,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ResolverOpts
impl PartialEq for ResolverOpts
source§fn eq(&self, other: &ResolverOpts) -> bool
fn eq(&self, other: &ResolverOpts) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ResolverOpts
impl Serialize for ResolverOpts
impl Eq for ResolverOpts
impl StructuralPartialEq for ResolverOpts
Auto Trait Implementations§
impl Freeze for ResolverOpts
impl RefUnwindSafe for ResolverOpts
impl Send for ResolverOpts
impl Sync for ResolverOpts
impl Unpin for ResolverOpts
impl UnwindSafe for ResolverOpts
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.