pub struct NameserverSpec {
pub protocol: NameserverProtocol,
pub host: String,
pub port: u16,
pub path: Option<String>,
}Expand description
A parsed upstream nameserver specification.
Produced by NameserverSpec::parse from the opaque nameserver strings
accepted everywhere in seer (CLI flags, REPL @server, config.toml).
Fields§
§protocol: NameserverProtocolTransport to speak to the upstream server.
host: StringHostname or IP literal (IPv6 stored unbracketed).
port: u16Target port (defaulted per protocol: 53 / 853 / 443).
path: Option<String>DoH query path. Always Some for NameserverProtocol::Https
(defaulting to /dns-query), always None otherwise.
Implementations§
Source§impl NameserverSpec
impl NameserverSpec
Sourcepub fn parse(input: &str) -> Result<Self>
pub fn parse(input: &str) -> Result<Self>
Parses a nameserver specification string.
Accepted forms:
IP,hostname,host:port,[v6],[v6]:port→ UDP (port 53)tls://host[:port]→ DoT (port 853)https://host[:port][/path]→ DoH (port 443, path/dns-query)
§Errors
Returns SeerError::InvalidInput for empty input, embedded
whitespace, unknown schemes, malformed brackets, bad ports, a path on
a tls:// spec, or credentials in an https:// spec.
Sourcepub fn tls_name(&self) -> &str
pub fn tls_name(&self) -> &str
The TLS server name presented for certificate verification (DoT/DoH).
For hostname specs this is the hostname. For IP-literal specs it is the IP itself: rustls accepts IP-address server names and verifies them against the certificate’s IP SANs, which the major public resolvers (1.1.1.1, 8.8.8.8, 9.9.9.9, …) all carry.
Trait Implementations§
Source§impl Clone for NameserverSpec
impl Clone for NameserverSpec
Source§fn clone(&self) -> NameserverSpec
fn clone(&self) -> NameserverSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NameserverSpec
impl Debug for NameserverSpec
Source§impl Display for NameserverSpec
impl Display for NameserverSpec
impl Eq for NameserverSpec
Source§impl PartialEq for NameserverSpec
impl PartialEq for NameserverSpec
impl StructuralPartialEq for NameserverSpec
Auto Trait Implementations§
impl Freeze for NameserverSpec
impl RefUnwindSafe for NameserverSpec
impl Send for NameserverSpec
impl Sync for NameserverSpec
impl Unpin for NameserverSpec
impl UnsafeUnpin for NameserverSpec
impl UnwindSafe for NameserverSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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