Exclave icon indicating copy to clipboard operation
Exclave copied to clipboard

DoH/UDP DNS context deadline exceeded

Open dyhkwong opened this issue 1 year ago • 1 comments

Describe the bug

app/dns: failed to retrieve response > Post "https://1.1.1.1/dns-query": context deadline exceeded

To Reproduce

  1. Use DoH as the remote/direct DNS (e.g. https://1.1.1.1/dns-query, https+local://223.5.5.5/dns-query)
  2. Interupt the connection (e.g. by switching network environment) when there are active DNS queries
  3. DNS queries always fail and report app/dns: failed to retrieve response > Post "https://1.1.1.1/dns-query": context deadline exceeded

Additional context

I can reproduce the same error on v2rayNG (Xray-core), so this is not a bug introduced here.

Removing DoH keepalive won't help.

Although only http.Transport is different, DoH3 (e.g. h3://1.1.1.1/dns-query) does not have this issue and can automatically recover from context deadline exceeded.

When using quic-go http3 v0.43.0-v0.45.0, DoH3 does have this issue but this was later fixed in quic-go v0.45.1. For unknown reason, the same thing happens on DoH (which uses net/http).

dyhkwong avatar Aug 05 '24 09:08 dyhkwong

Update: Maybe 0.11.3/0.12.0-beta04 fixed (more preciously, workarounded) this.

dyhkwong avatar Sep 15 '24 17:09 dyhkwong

Since unknown time, this has been happening for DNS over H3.

dyhkwong avatar Aug 07 '25 06:08 dyhkwong

Done in 0.15.5. (Just a workaround not a fix?)

dyhkwong avatar Aug 18 '25 18:08 dyhkwong