pub struct DnsConfig {
pub magic_dns: bool,
pub search_domains: Vec<String>,
pub extra_records: Vec<ExtraRecord>,
pub resolvers: Vec<Resolver>,
pub routes: BTreeMap<String, Vec<Resolver>>,
pub fallback_resolvers: Vec<Resolver>,
pub exit_node_filtered_set: Vec<String>,
pub cert_domains: Vec<String>,
}Expand description
The netmap DNS configuration returned by Device::dns_config (Go netmap.NetworkMap.DNS).
Owned DNS configuration distilled from the control MapResponse for the MagicDNS responder.
Fields§
§magic_dns: boolMagicDNS enabled (Go Proxied). When false the responder serves nothing (fail closed).
search_domains: Vec<String>Tailnet DNS suffix(es), lowercased, no trailing dot, e.g. “user.ts.net”.
extra_records: Vec<ExtraRecord>Control-pushed static A/AAAA host records (Go ExtraRecords).
resolvers: Vec<Resolver>Global upstream resolvers (Go Resolvers) used to recursively resolve non-overlay names
when no split-DNS route and no fallback resolver matches.
routes: BTreeMap<String, Vec<Resolver>>Split-DNS routes (Go Routes): suffix (canonicalized, no leading/trailing dot) -> the
upstreams that answer that suffix. An empty upstream list is a negative route: names
under that suffix are not resolved (Go keeps them on the built-in resolver, which for us
means fail-closed NXDOMAIN unless an overlay/extra record matches).
fallback_resolvers: Vec<Resolver>Fallback resolvers (Go FallbackResolvers) used for non-overlay names that match no route,
preferred over resolvers.
exit_node_filtered_set: Vec<String>DNS suffixes this node, when acting as an exit-node DNS proxy, must not answer (Go
ExitNodeFilteredSet). Entries are lowercased, no trailing dot. An entry starting with a
period is a suffix match (but .a.b does NOT match a.b — a real prefix label is
required); an entry without a leading period is an exact match. Matching is
case-insensitive. A filtered name is answered with REFUSED. See
DnsConfig::exit_node_filters.
cert_domains: Vec<String>DNS names control will assist provisioning TLS certs for (Go tailcfg.DNSConfig.CertDomains):
the cert-eligible FQDNs for this node, without trailing dots or _acme-challenge. prefix.
Surfaced verbatim (Go returns slices.Clone(nm.DNS.CertDomains)); empty when control sent none.
Implementations§
Source§impl DnsConfig
impl DnsConfig
Sourcepub fn from_serde(c: &Config<'_>) -> DnsConfig
pub fn from_serde(c: &Config<'_>) -> DnsConfig
Build the owned config from the borrowed serde view parsed off the wire.
Sourcepub fn exit_node_filters(&self, name: &str) -> bool
pub fn exit_node_filters(&self, name: &str) -> bool
Whether name (a canonical query name: lowercased, no trailing dot) is in this config’s
exit_node_filtered_set and so must be REFUSED when
this node answers as an exit-node DNS proxy (Go dnsConfigForNetmap’s filtered-set check).
An entry with a leading period is a suffix match requiring a real label before it (.a.b
matches x.a.b but not a.b); an entry without a leading period is an exact match.
Matching is case-insensitive (both sides are already lowercased).
Sourcepub fn resolvers_with_exit_node(&self) -> impl Iterator<Item = &Resolver>
pub fn resolvers_with_exit_node(&self) -> impl Iterator<Item = &Resolver>
The resolvers to keep when an exit node is active: those flagged
use_with_exit_node. When an exit node is selected,
recursive resolution is delegated to it, except for these explicitly-flagged resolvers (Go
keeps UseWithExitNode resolvers in the local config).
Trait Implementations§
impl Eq for DnsConfig
impl StructuralPartialEq for DnsConfig
Auto Trait Implementations§
impl Freeze for DnsConfig
impl RefUnwindSafe for DnsConfig
impl Send for DnsConfig
impl Sync for DnsConfig
impl Unpin for DnsConfig
impl UnsafeUnpin for DnsConfig
impl UnwindSafe for DnsConfig
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn<'a>(
self: Box<T>,
state: &'a mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
stop: &'a mut bool,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
fn handle_dyn<'a>( self: Box<T>, state: &'a mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, stop: &'a mut bool, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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