Struct resolve::config::DnsConfig
[−]
[src]
pub struct DnsConfig { pub name_servers: Vec<SocketAddr>, pub search: Vec<String>, pub n_dots: u32, pub timeout: Duration, pub attempts: u32, pub rotate: bool, pub use_inet6: bool, }
Configures the behavior of DNS requests
Fields
name_servers: Vec<SocketAddr>
List of name servers; must not be empty
search: Vec<String>
List of search domains
n_dots: u32
Minimum number of dots in a name to trigger an initial absolute query
timeout: Duration
Duration before retrying or failing an unanswered request
attempts: u32
Number of attempts made before returning an error
rotate: bool
Whether to rotate through available nameservers
use_inet6: bool
If true
, perform AAAA
queries first and return IPv4 addresses
as IPv4-mapped IPv6 addresses.
Methods
impl DnsConfig
[src]
fn load_default() -> Result<DnsConfig>
[src]
Returns the default system configuration for DNS requests.
fn with_name_servers(name_servers: Vec<SocketAddr>) -> DnsConfig
[src]
Returns a DnsConfig
using the given set of name servers,
setting all other fields to generally sensible default values.
Trait Implementations
impl Clone for DnsConfig
[src]
fn clone(&self) -> DnsConfig
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more