fix: macOS DNS restore failed

This commit is contained in:
huzibaca 2024-11-22 03:09:39 +08:00
parent 4ffadab4c5
commit 1b65dc7256
No known key found for this signature in database
GPG Key ID: D4364EE4851DC302

View File

@ -36,7 +36,10 @@ pub async fn use_tun(mut config: Mapping, enable: bool) -> Mapping {
revise!(dns_val, "enhanced-mode", "fake-ip");
revise!(dns_val, "fake-ip-range", "10.96.0.0/16");
#[cfg(target_os = "macos")]
crate::utils::resolve::set_public_dns("10.96.0.2".to_string()).await;
{
crate::utils::resolve::restore_public_dns().await;
crate::utils::resolve::set_public_dns("10.96.0.2".to_string()).await;
}
} else {
revise!(dns_val, "enhanced-mode", "redir-host");
#[cfg(target_os = "macos")]