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 ccf9b13e04 - Show all commits

View File

@@ -218,8 +218,14 @@ mod tests {
assert_eq!(addrs, original);
}
// On Windows, Instant starts near boot time — large subtractions overflow.
// Fall back to a fixed reference point created at process start.
static EPOCH: std::sync::OnceLock<Instant> = std::sync::OnceLock::new();
fn age(secs: u64) -> Instant {
Instant::now() - std::time::Duration::from_secs(secs)
Instant::now()
.checked_sub(std::time::Duration::from_secs(secs))
.unwrap_or(*EPOCH.get_or_init(Instant::now))
}
/// Cache with ip(1) saturated at FAILURE_PENALTY_MS