feat: Windows DNS configuration via netsh #28

Merged
razvandimescu merged 16 commits from feat/windows-dns-config into main 2026-04-01 23:17:52 +08:00
Showing only changes of commit f4342b9844 - Show all commits

View File

@@ -14,6 +14,8 @@ use numa::ctx::{handle_query, ServerCtx};
use numa::forward::Upstream;
use numa::override_store::OverrideStore;
use numa::query_log::QueryLog;
const DOH_FALLBACK: &str = "https://9.9.9.9/dns-query";
use numa::service_store::ServiceStore;
use numa::stats::ServerStats;
use numa::system_dns::{
@@ -126,7 +128,7 @@ async fn main() -> numa::Result<()> {
.use_rustls_tls()
.build()
.unwrap_or_default();
let url = "https://9.9.9.9/dns-query".to_string();
let url = DOH_FALLBACK.to_string();
let label = url.clone();
(
numa::config::UpstreamMode::Forward,
@@ -152,7 +154,7 @@ async fn main() -> numa::Result<()> {
.or_else(numa::system_dns::detect_dhcp_dns)
.unwrap_or_else(|| {
info!("could not detect system DNS, falling back to Quad9 DoH");
"https://9.9.9.9/dns-query".to_string()
DOH_FALLBACK.to_string()
})
} else {
config.upstream.address.clone()