Struct clash_doc::ClashDNSConfigDef
pub struct ClashDNSConfigDef {
pub enable: bool,
pub ipv6: bool,
pub user_hosts: bool,
pub nameserver: Vec<String, Global>,
pub fallback: Vec<String, Global>,
pub fallback_filter: FallbackFilter,
pub listen: Option<DNSListen>,
pub enhanced_mode: DNSMode,
pub fake_ip_range: String,
pub fake_ip_filter: Vec<String, Global>,
pub default_nameserver: Vec<String, Global>,
pub nameserver_policy: HashMap<String, String, RandomState>,
}
Expand description
DNS client/server settings This section is optional. When not present, the DNS server will be disabled and system DNS config will be used
Example
dns:
enable: true
ipv6: false # when the false, response to AAAA questions will be empty
listen:
udp: 127.0.0.1:5353
tcp: 127.0.0.1:5353
doh: 127.0.0.1:5354
dot: 127.0.0.1:5355
Fields§
§enable: bool
When disabled, system DNS config will be used All other DNS related options will only be used when this is enabled
ipv6: bool
When false, response to AAAA questions will be empty
user_hosts: bool
Whether to Config::hosts
as when resolving hostnames
nameserver: Vec<String, Global>
DNS servers
fallback: Vec<String, Global>
Fallback DNS servers
fallback_filter: FallbackFilter
Fallback DNS filter
listen: Option<DNSListen>
DNS server listening address. If not present, the DNS server will be disabled.
enhanced_mode: DNSMode
Whether to use fake IP addresses
fake_ip_range: String
Fake IP addresses pool CIDR
fake_ip_filter: Vec<String, Global>
Fake IP addresses filter
default_nameserver: Vec<String, Global>
Default nameservers, used to resolve DoH hostnames
nameserver_policy: HashMap<String, String, RandomState>
Lookup domains via specific nameservers
Trait Implementations§
§impl<'de> Deserialize<'de> for DNSwhere
DNS: Default,
impl<'de> Deserialize<'de> for DNSwhere DNS: Default,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<DNS, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<DNS, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for DNS
impl Serialize for DNS
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more