pub struct NameserverConfig { /* private fields */ }Expand description
A DNS nameserver configuration for a single server.
Implementations§
Source§impl NameserverConfig
impl NameserverConfig
Sourcepub fn udp(addr: IpAddr) -> Self
pub fn udp(addr: IpAddr) -> Self
Creates a new nameserver config for DNS over UDP (Do53).
This nameserver will be using DNS over UDP on port 53, see
Self::with_port to further customise this nameserver.
Sourcepub fn tcp(addr: IpAddr) -> Self
pub fn tcp(addr: IpAddr) -> Self
Creates a new nameserver config for DNS over TCP (Do53).
This nameserver will be using DNS over TCP on port 53, see
Self::with_port to further customise this nameserver.
Sourcepub fn tls(addr: IpAddr) -> Self
pub fn tls(addr: IpAddr) -> Self
Creates a new nameserver config for DNS over TLS (DoT).
This nameserver will be using DNS over TLS on port 853, see
Self::with_port and Self::with_tls_server_name to further customise
this nameserver.
Sourcepub fn https(addr: IpAddr) -> Self
pub fn https(addr: IpAddr) -> Self
Creates a new nameserver config for DNS over HTTPS (DoH).
This nameserver will be using DNS over HTTPS on port 443, see
Self::with_port and Self::with_tls_server_name to further customise
this nameserver.
Sourcepub fn with_port(self, port: u16) -> Self
pub fn with_port(self, port: u16) -> Self
Sets the port for the nameserver.
§Returns
A new instance is returned, this struct is essentially a builder for itself.
Sourcepub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
pub fn with_tls_server_name(self, server_name: impl Into<String>) -> Self
Sets the TLS server name for the nameserver.
Nameservers are always connected to via IP address. However for the protocols
running over TLS (DoT & DoH), the server certificate may use a server name rather
than IP address. When enabled the TLS ClientHello will use this server name in the
SNI.
§Returns
A new instance is returned, this struct is essentially a builder for itself.
Trait Implementations§
Source§impl Clone for NameserverConfig
impl Clone for NameserverConfig
Source§fn clone(&self) -> NameserverConfig
fn clone(&self) -> NameserverConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NameserverConfig
impl Debug for NameserverConfig
Source§impl PartialEq for NameserverConfig
impl PartialEq for NameserverConfig
impl Eq for NameserverConfig
impl StructuralPartialEq for NameserverConfig
Auto Trait Implementations§
impl Freeze for NameserverConfig
impl RefUnwindSafe for NameserverConfig
impl Send for NameserverConfig
impl Sync for NameserverConfig
impl Unpin for NameserverConfig
impl UnwindSafe for NameserverConfig
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.