Merge pull request #6 from vffuunnyy/dev

feat: replace AliDNS with Google and Cloudflare DNS servers
This commit is contained in:
coolcoala
2025-08-08 01:45:17 +03:00
committed by GitHub
3 changed files with 13 additions and 11 deletions

View File

@@ -60,7 +60,7 @@ pub async fn use_tun(mut config: Mapping, enable: bool) -> Mapping {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
{ {
crate::utils::resolve::restore_public_dns().await; crate::utils::resolve::restore_public_dns().await;
crate::utils::resolve::set_public_dns("223.6.6.6".to_string()).await; crate::utils::resolve::set_public_dns("8.8.8.8".to_string()).await;
} }
} }

View File

@@ -178,9 +178,8 @@ fn init_dns_config() -> Result<()> {
"default-nameserver".into(), "default-nameserver".into(),
Value::Sequence(vec![ Value::Sequence(vec![
Value::String("system".into()), Value::String("system".into()),
Value::String("223.6.6.6".into()),
Value::String("8.8.8.8".into()), Value::String("8.8.8.8".into()),
Value::String("2400:3200::1".into()), Value::String("1.1.1.1".into()),
Value::String("2001:4860:4860::8888".into()), Value::String("2001:4860:4860::8888".into()),
]), ]),
), ),
@@ -189,7 +188,8 @@ fn init_dns_config() -> Result<()> {
Value::Sequence(vec![ Value::Sequence(vec![
Value::String("8.8.8.8".into()), Value::String("8.8.8.8".into()),
Value::String("https://doh.pub/dns-query".into()), Value::String("https://doh.pub/dns-query".into()),
Value::String("https://dns.alidns.com/dns-query".into()), Value::String("https://dns.google/dns-query".into()),
Value::String("https://cloudflare-dns.com/dns-query".into()),
]), ]),
), ),
("fallback".into(), Value::Sequence(vec![])), ("fallback".into(), Value::Sequence(vec![])),
@@ -201,8 +201,9 @@ fn init_dns_config() -> Result<()> {
"proxy-server-nameserver".into(), "proxy-server-nameserver".into(),
Value::Sequence(vec![ Value::Sequence(vec![
Value::String("https://doh.pub/dns-query".into()), Value::String("https://doh.pub/dns-query".into()),
Value::String("https://dns.alidns.com/dns-query".into()), Value::String("https://dns.google/dns-query".into()),
Value::String("tls://223.5.5.5".into()), Value::String("https://cloudflare-dns.com/dns-query".into()),
Value::String("tls://1.1.1.1".into()),
]), ]),
), ),
("direct-nameserver".into(), Value::Sequence(vec![])), ("direct-nameserver".into(), Value::Sequence(vec![])),

View File

@@ -58,22 +58,23 @@ const DEFAULT_DNS_CONFIG = {
], ],
"default-nameserver": [ "default-nameserver": [
"system", "system",
"223.6.6.6",
"8.8.8.8", "8.8.8.8",
"2400:3200::1", "1.1.1.1",
"2001:4860:4860::8888", "2001:4860:4860::8888",
], ],
nameserver: [ nameserver: [
"8.8.8.8", "8.8.8.8",
"https://doh.pub/dns-query", "https://doh.pub/dns-query",
"https://dns.alidns.com/dns-query", "https://dns.google/dns-query",
"https://cloudflare-dns.com/dns-query",
], ],
fallback: [], fallback: [],
"nameserver-policy": {}, "nameserver-policy": {},
"proxy-server-nameserver": [ "proxy-server-nameserver": [
"https://doh.pub/dns-query", "https://doh.pub/dns-query",
"https://dns.alidns.com/dns-query", "https://dns.google/dns-query",
"tls://223.5.5.5", "https://cloudflare-dns.com/dns-query",
"tls://1.1.1.1",
], ],
"direct-nameserver": [], "direct-nameserver": [],
"direct-nameserver-follow-policy": false, "direct-nameserver-follow-policy": false,