Merge pull request #135 from razvandimescu/fix/hedge-default-off

fix(upstream): default hedge_ms=0 to avoid silent 2x upstream query count
This commit was merged in pull request #135.
This commit is contained in:
Razvan Dimescu
2026-04-22 23:49:15 +03:00
committed by GitHub
2 changed files with 12 additions and 6 deletions

View File

@@ -30,11 +30,13 @@ api_port = 5380
# fallback = ["8.8.8.8", "1.1.1.1"] # tried only when all primaries fail # fallback = ["8.8.8.8", "1.1.1.1"] # tried only when all primaries fail
# port = 53 # default port for addresses without :port # port = 53 # default port for addresses without :port
# timeout_ms = 3000 # timeout_ms = 3000
# hedge_ms = 10 # request hedging delay (ms). After this delay # hedge_ms = 0 # request hedging delay (ms). Default: 0 (off).
# # without a response, fires a parallel request # # Set to e.g. 10 to fire a parallel upstream
# # to the same upstream. Rescues packet loss (UDP), # # request after 10ms of silence — rescues packet
# # dispatch spikes (DoH), TLS stalls (DoT). # # loss (UDP), dispatch spikes (DoH), TLS stalls
# # Set to 0 to disable. Default: 10 # # (DoT). Doubles the upstream query count, so
# # leave off for quota'd providers (NextDNS,
# # Control D).
# ODoH (Oblivious DNS-over-HTTPS, RFC 9230). The relay sees your IP but # ODoH (Oblivious DNS-over-HTTPS, RFC 9230). The relay sees your IP but
# not the question; the target sees the question but not your IP. Numa # not the question; the target sees the question but not your IP. Numa

View File

@@ -451,8 +451,12 @@ fn default_upstream_port() -> u16 {
fn default_timeout_ms() -> u64 { fn default_timeout_ms() -> u64 {
5000 5000
} }
/// Off by default: hedging fires a second upstream query, which silently
/// doubles the count at the provider — hurts quota'd DNS (NextDNS, Control
/// D). Opt in with `hedge_ms = 10` for tail-latency rescue on flaky nets
/// or handshake-slow DoT.
fn default_hedge_ms() -> u64 { fn default_hedge_ms() -> u64 {
10 0
} }
#[derive(Deserialize)] #[derive(Deserialize)]