Skip to main content

DnsConfig

Struct DnsConfig 

Source
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

Owned DNS configuration distilled from the control MapResponse for the MagicDNS responder.

Fields§

§magic_dns: bool

MagicDNS 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

Source

pub fn from_serde(c: &DnsConfig<'_>) -> Self

Build the owned config from the borrowed serde view parsed off the wire.

Source

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).

Source

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§

Source§

impl Clone for DnsConfig

Source§

fn clone(&self) -> DnsConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DnsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DnsConfig

Source§

fn default() -> DnsConfig

Returns the “default value” for a type. Read more
Source§

impl Eq for DnsConfig

Source§

impl PartialEq for DnsConfig

Source§

fn eq(&self, other: &DnsConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DnsConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more