Struct ResolverConfig
pub struct ResolverConfig { /* private fields */ }Expand description
Configuration for the upstream nameservers to use for resolution
Implementations§
§impl ResolverConfig
impl ResolverConfig
pub fn new() -> ResolverConfig
pub fn new() -> ResolverConfig
Creates a new empty configuration
pub fn google() -> ResolverConfig
pub fn google() -> 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.
NameServerConfigGroups can be combined to use a set of different providers, see
NameServerConfigGroup and ResolverConfig::from_parts
pub fn cloudflare() -> ResolverConfig
pub fn cloudflare() -> ResolverConfig
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
pub fn quad9() -> ResolverConfig
pub fn quad9() -> ResolverConfig
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
pub fn from_parts<G>(
domain: Option<Name>,
search: Vec<Name>,
name_servers: G,
) -> ResolverConfigwhere
G: Into<NameServerConfigGroup>,
pub fn from_parts<G>(
domain: Option<Name>,
search: Vec<Name>,
name_servers: G,
) -> ResolverConfigwhere
G: Into<NameServerConfigGroup>,
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
pub 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
pub fn set_domain(&mut self, domain: Name)
pub fn set_domain(&mut self, domain: Name)
Set the domain of the entity querying results.
pub 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
pub fn add_search(&mut self, search: Name)
pub fn add_search(&mut self, search: Name)
Add a search domain
pub 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
pub fn name_servers(&self) -> &[NameServerConfig]
pub fn name_servers(&self) -> &[NameServerConfig]
Returns a reference to the name servers
Trait Implementations§
§impl Clone for ResolverConfig
impl Clone for ResolverConfig
§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 more§impl Debug for ResolverConfig
impl Debug for ResolverConfig
§impl Default for ResolverConfig
impl Default for ResolverConfig
§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.
Auto Trait Implementations§
impl Freeze for ResolverConfig
impl RefUnwindSafe for ResolverConfig
impl Send for ResolverConfig
impl Sync for ResolverConfig
impl Unpin for ResolverConfig
impl UnwindSafe for ResolverConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more