pub struct HickoryResolver { /* private fields */ }Expand description
The production resolver, reading /etc/resolv.conf at startup.
Implementations§
Source§impl HickoryResolver
impl HickoryResolver
Sourcepub fn from_system() -> Result<Self>
pub fn from_system() -> Result<Self>
Builds a resolver from the system configuration, with hickory’s default cache.
Sourcepub fn from_system_uncached() -> Result<Self>
pub fn from_system_uncached() -> Result<Self>
Same, with caching disabled.
dns-01 asks about a record the client has just published, so a cached
negative answer would fail a challenge that is in fact satisfied — for the
whole negative TTL, which the client does not control. Answering from the
authoritative servers every time is the point of the lookup.
Sourcepub fn from_address(addr: SocketAddr) -> Result<Self>
pub fn from_address(addr: SocketAddr) -> Result<Self>
Builds a resolver querying only addr (config.dns.resolver), instead of
the system configuration. Used by reverse_dns, which wants caching.
Sourcepub fn from_address_uncached(addr: SocketAddr) -> Result<Self>
pub fn from_address_uncached(addr: SocketAddr) -> Result<Self>
Same, with caching disabled — the dns-01 counterpart of
Self::from_address, for the same reason Self::from_system_uncached
disables it.
Trait Implementations§
Source§impl Resolver for HickoryResolver
impl Resolver for HickoryResolver
Source§fn reverse<'life0, 'async_trait>(
&'life0 self,
ip: IpAddr,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reverse<'life0, 'async_trait>(
&'life0 self,
ip: IpAddr,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
hickory’s *_lookup methods (used here and in Self::forward and
Self::txt) surface both NXDOMAIN and an empty NOERROR answer as
Err(NetError), not Ok with no records — so without distinguishing
is_no_records_found() in each of the three, “the client just
doesn’t have this record” (the ordinary shape of “no PTR record for
this address”, or a dns-01 TXT record not published yet) is
indistinguishable from the resolver genuinely failing (SERVFAIL,
timeout). filter::reverse_dns depends
on telling those apart: the former denies the request, the latter is
a 500 the client can retry. (dns_01 happens not to care — both
cases map to the same ChallengeError::Dns there — which is why this
went uncaught until reverse_dns was first exercised against a real
resolver, in the podman-compose lab’s filters/reverse_dns.)
Auto Trait Implementations§
impl !RefUnwindSafe for HickoryResolver
impl !UnwindSafe for HickoryResolver
impl Freeze for HickoryResolver
impl Send for HickoryResolver
impl Sync for HickoryResolver
impl Unpin for HickoryResolver
impl UnsafeUnpin for HickoryResolver
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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