pub struct ResolverConfig { /* private fields */ }memberlist-net and dns only.Expand description
Configuration for the upstream nameservers to use for resolution
Implementations§
Source§impl ResolverConfig
impl ResolverConfig
Sourcepub fn new() -> ResolverConfig
Available on crate feature agnostic only.
pub fn new() -> ResolverConfig
agnostic only.Creates a new empty configuration
Sourcepub fn google() -> ResolverConfig
Available on crate feature agnostic only.
pub fn google() -> ResolverConfig
agnostic 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).
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() -> ResolverConfig
Available on crate features agnostic and __tls only.
pub fn google_tls() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate features agnostic and __https only.
pub fn google_https() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate features agnostic and __h3 only.
pub fn google_h3() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate feature agnostic only.
pub fn cloudflare() -> ResolverConfig
agnostic only.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() -> ResolverConfig
Available on crate features agnostic and __tls only.
pub fn cloudflare_tls() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate features agnostic and __https only.
pub fn cloudflare_https() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate feature agnostic only.
pub fn quad9() -> ResolverConfig
agnostic 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 (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() -> ResolverConfig
Available on crate features agnostic and __tls only.
pub fn quad9_tls() -> ResolverConfig
agnostic and __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() -> ResolverConfig
Available on crate features agnostic and __https only.
pub fn quad9_https() -> ResolverConfig
agnostic and __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>(
domain: Option<Name>,
search: Vec<Name>,
name_servers: G,
) -> ResolverConfigwhere
G: Into<NameServerConfigGroup>,
Available on crate feature agnostic only.
pub fn from_parts<G>(
domain: Option<Name>,
search: Vec<Name>,
name_servers: G,
) -> ResolverConfigwhere
G: Into<NameServerConfigGroup>,
agnostic only.Create a ResolverConfig with all parts specified
§Arguments
domain- domain of the entity querying results. If theNamebeing looked up is not an FQDN, then this is the first part appended to attempt a lookup.ndotsin theResolverOptiondoes take precedence over this.search- additional search domains that are attempted if theNameis 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.4and2001:4860:4860::8888,2001:4860:4860::8844
Sourcepub fn domain(&self) -> Option<&Name>
Available on crate feature agnostic only.
pub fn domain(&self) -> Option<&Name>
agnostic only.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)
Available on crate feature agnostic only.
pub fn set_domain(&mut self, domain: Name)
agnostic only.Set the domain of the entity querying results.
Sourcepub fn search(&self) -> &[Name]
Available on crate feature agnostic only.
pub fn search(&self) -> &[Name]
agnostic only.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)
Available on crate feature agnostic only.
pub fn add_search(&mut self, search: Name)
agnostic only.Add a search domain
Sourcepub fn add_name_server(&mut self, name_server: NameServerConfig)
Available on crate feature agnostic only.
pub fn add_name_server(&mut self, name_server: NameServerConfig)
agnostic only.Add the configuration for a name server
Sourcepub fn name_servers(&self) -> &[NameServerConfig]
Available on crate feature agnostic only.
pub fn name_servers(&self) -> &[NameServerConfig]
agnostic only.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() -> ResolverConfig
fn default() -> ResolverConfig
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.
Source§impl<'de> Deserialize<'de> for ResolverConfig
impl<'de> Deserialize<'de> for ResolverConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResolverConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResolverConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ResolverConfig
impl Serialize for ResolverConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ResolverConfig
impl RefUnwindSafe for ResolverConfig
impl Send for ResolverConfig
impl Sync for ResolverConfig
impl Unpin for ResolverConfig
impl UnsafeUnpin for ResolverConfig
impl UnwindSafe for ResolverConfig
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more