pub struct DnsConfig {
pub upstream_servers: Vec<String>,
pub split_dns_domains: Vec<String>,
pub blocked_domains: Vec<String>,
pub enable_cache: bool,
pub cache_ttl: Duration,
pub max_cache_size: usize,
}Expand description
Configuration for DNS leak protection.
Fields§
§upstream_servers: Vec<String>Upstream DNS servers to use (inside the tunnel).
split_dns_domains: Vec<String>Local/split DNS domains that bypass the tunnel (e.g. “corp.internal”).
blocked_domains: Vec<String>Domains to block completely (ad/tracking blocklist).
enable_cache: boolWhether to cache DNS responses.
cache_ttl: DurationTTL for cached entries.
max_cache_size: usizeMaximum cache size.
Implementations§
Source§impl DnsConfig
impl DnsConfig
Sourcepub fn cloudflare() -> Self
pub fn cloudflare() -> Self
Config using Cloudflare DNS (1.1.1.1).
Sourcepub fn with_split_domain(self, domain: &str) -> Self
pub fn with_split_domain(self, domain: &str) -> Self
Add a split DNS domain (goes directly, not through tunnel).
Sourcepub fn with_blocked_domain(self, domain: &str) -> Self
pub fn with_blocked_domain(self, domain: &str) -> Self
Add a blocked domain.
Trait Implementations§
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
Mutably borrows from an owned value. Read more