pub struct ResolverConfig { /* private fields */ }
Expand description
Configuration for the upstream nameservers to use for resolution
Implementations§
Source§impl ResolverConfig
impl ResolverConfig
Sourcepub fn google() -> Self
pub fn google() -> Self
Creates a default configuration, using 8.8.8.8
, 8.8.4.4
and 2001:4860:4860::8888
,
2001:4860:4860::8844
(thank you, Google).
Please see Google’s privacy
statement for important information
about what they track, many ISP’s track similar information in DNS. To use the system
configuration see: Resolver::from_system_conf
.
NameServerConfigGroups can be combined to use a set of different providers, see
NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn google_tls() -> Self
Available on crate feature __tls
only.
pub fn google_tls() -> Self
__tls
only.Creates a default configuration, using 8.8.8.8
, 8.8.4.4
and 2001:4860:4860::8888
,
2001:4860:4860::8844
(thank you, Google). This limits the registered connections to just
TLS lookups
Please see Google’s privacy
statement for important information
about what they track, many ISP’s track similar information in DNS. To use the system
configuration see: Resolver::from_system_conf
.
NameServerConfigGroups can be combined to use a set of different providers, see
NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn google_https() -> Self
Available on crate feature __https
only.
pub fn google_https() -> Self
__https
only.Creates a default configuration, using 8.8.8.8
, 8.8.4.4
and 2001:4860:4860::8888
,
2001:4860:4860::8844
(thank you, Google). This limits the registered connections to just
HTTPS lookups
Please see Google’s privacy
statement for important information
about what they track, many ISP’s track similar information in DNS. To use the system
configuration see: Resolver::from_system_conf
.
NameServerConfigGroups can be combined to use a set of different providers, see
NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn google_h3() -> Self
Available on crate feature __h3
only.
pub fn google_h3() -> Self
__h3
only.Creates a default configuration, using 8.8.8.8
, 8.8.4.4
and 2001:4860:4860::8888
,
2001:4860:4860::8844
(thank you, Google). This limits the registered connections to just
HTTP/3 lookups
Please see Google’s privacy
statement for important information
about what they track, many ISP’s track similar information in DNS. To use the system
configuration see: Resolver::from_system_conf
.
NameServerConfigGroups can be combined to use a set of different providers, see
NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn cloudflare() -> Self
pub fn cloudflare() -> Self
Creates a default configuration, using 1.1.1.1
, 1.0.0.1
and 2606:4700:4700::1111
, 2606:4700:4700::1001
(thank you, Cloudflare).
Please see: https://www.cloudflare.com/dns/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn cloudflare_tls() -> Self
Available on crate feature __tls
only.
pub fn cloudflare_tls() -> Self
__tls
only.Creates a configuration, using 1.1.1.1
, 1.0.0.1
and 2606:4700:4700::1111
, 2606:4700:4700::1001
(thank you, Cloudflare). This limits the registered connections to just TLS lookups
Please see: https://www.cloudflare.com/dns/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn cloudflare_https() -> Self
Available on crate feature __https
only.
pub fn cloudflare_https() -> Self
__https
only.Creates a configuration, using 1.1.1.1
, 1.0.0.1
and 2606:4700:4700::1111
, 2606:4700:4700::1001
(thank you, Cloudflare). This limits the registered connections to just HTTPS lookups
Please see: https://www.cloudflare.com/dns/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn quad9() -> Self
pub fn quad9() -> Self
Creates a configuration, using 9.9.9.9
, 149.112.112.112
and 2620:fe::fe
, 2620:fe::fe:9
, the “secure” variants of the quad9 settings (thank you, Quad9).
Please see: https://www.quad9.net/faq/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn quad9_tls() -> Self
Available on crate feature __tls
only.
pub fn quad9_tls() -> Self
__tls
only.Creates a configuration, using 9.9.9.9
, 149.112.112.112
and 2620:fe::fe
, 2620:fe::fe:9
, the “secure” variants of the quad9 settings. This limits the registered connections to just TLS lookups
Please see: https://www.quad9.net/faq/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn quad9_https() -> Self
Available on crate feature __https
only.
pub fn quad9_https() -> Self
__https
only.Creates a configuration, using 9.9.9.9
, 149.112.112.112
and 2620:fe::fe
, 2620:fe::fe:9
, the “secure” variants of the quad9 settings. This limits the registered connections to just HTTPS lookups
Please see: https://www.quad9.net/faq/
NameServerConfigGroups can be combined to use a set of different providers, see NameServerConfigGroup
and ResolverConfig::from_parts
Sourcepub fn from_parts<G: Into<NameServerConfigGroup>>(
domain: Option<Name>,
search: Vec<Name>,
name_servers: G,
) -> Self
pub fn from_parts<G: Into<NameServerConfigGroup>>( domain: Option<Name>, search: Vec<Name>, name_servers: G, ) -> Self
Create a ResolverConfig with all parts specified
§Arguments
domain
- domain of the entity querying results. If theName
being looked up is not an FQDN, then this is the first part appended to attempt a lookup.ndots
in theResolverOption
does take precedence over this.search
- additional search domains that are attempted if theName
is not found indomain
, defaults tovec![]
name_servers
- set of name servers to use for lookups, defaults are Google:8.8.8.8
,8.8.4.4
and2001:4860:4860::8888
,2001:4860:4860::8844
Sourcepub fn domain(&self) -> Option<&Name>
pub fn domain(&self) -> Option<&Name>
Returns the local domain
By default any names will be appended to all non-fully-qualified-domain names, and searched for after any ndots rules
Sourcepub fn set_domain(&mut self, domain: Name)
pub fn set_domain(&mut self, domain: Name)
Set the domain of the entity querying results.
Sourcepub fn search(&self) -> &[Name]
pub fn search(&self) -> &[Name]
Returns the search domains
These will be queried after any local domain and then in the order of the set of search domains
Sourcepub fn add_search(&mut self, search: Name)
pub fn add_search(&mut self, search: Name)
Add a search domain
Sourcepub fn add_name_server(&mut self, name_server: NameServerConfig)
pub fn add_name_server(&mut self, name_server: NameServerConfig)
Add the configuration for a name server
Sourcepub fn name_servers(&self) -> &[NameServerConfig]
pub fn name_servers(&self) -> &[NameServerConfig]
Returns a reference to the name servers
Trait Implementations§
Source§impl Clone for ResolverConfig
impl Clone for ResolverConfig
Source§fn clone(&self) -> ResolverConfig
fn clone(&self) -> ResolverConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ResolverConfig
impl Debug for ResolverConfig
Source§impl Default for ResolverConfig
impl Default for ResolverConfig
Source§fn default() -> Self
fn default() -> Self
Creates a default configuration, using 8.8.8.8
, 8.8.4.4
and 2001:4860:4860::8888
,
2001:4860:4860::8844
(thank you, Google).
Please see Google’s privacy
statement for important information
about what they track, many ISP’s track similar information in DNS. To use the system
configuration see: Resolver::from_system_conf
.