pub struct NameServerConfig {
pub socket_addr: SocketAddr,
pub protocol: Protocol,
pub tls_dns_name: Option<String>,
pub http_endpoint: Option<String>,
pub trust_negative_responses: bool,
pub tls_config: Option<TlsClientConfig>,
pub bind_addr: Option<SocketAddr>,
}
Expand description
Configuration for the NameServer
Fields§
§socket_addr: SocketAddr
The address which the DNS NameServer is registered at.
protocol: Protocol
The protocol to use when communicating with the NameServer.
tls_dns_name: Option<String>
SPKI name, only relevant for TLS connections
http_endpoint: Option<String>
The HTTP endpoint where the DNS NameServer provides service. Only
relevant to DNS-over-HTTPS. Defaults to /dns-query
if unspecified.
trust_negative_responses: bool
Whether to trust NXDOMAIN
responses from upstream nameservers.
When this is true
, and an empty NXDOMAIN
response or NOERROR
with an empty answers set is received, the
query will not be retried against other configured name servers if
the response has the Authoritative flag set.
(On a response with any other error response code, the query will still be retried regardless of this configuration setting.)
Defaults to false.
tls_config: Option<TlsClientConfig>
dns-over-rustls
only.Optional configuration for the TLS client.
The correct ALPN for the corresponding protocol is automatically inserted if none was specificed.
bind_addr: Option<SocketAddr>
The client address (IP and port) to use for connecting to the server.
Implementations§
Source§impl NameServerConfig
impl NameServerConfig
Sourcepub fn new(socket_addr: SocketAddr, protocol: Protocol) -> Self
pub fn new(socket_addr: SocketAddr, protocol: Protocol) -> Self
Constructs a Nameserver configuration with some basic defaults
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<'de> Deserialize<'de> for NameServerConfig
impl<'de> Deserialize<'de> for NameServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for NameServerConfig
impl Display for NameServerConfig
Source§impl PartialEq for NameServerConfig
impl PartialEq for NameServerConfig
Source§impl Serialize for NameServerConfig
impl Serialize 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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.