diff --git a/dns/doh.go b/dns/doh.go index ad889ab1..ca5b655c 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -172,7 +172,7 @@ func (doh *dohTransport) RoundTrip(req *http.Request) (*http.Response, error) { var h3Err bool var fallbackErr bool defer func() { - if doh.preferH3 && h3Err { + if doh.preferH3 && (h3Err || fallbackErr) { doh.canUseH3.Store(doh.preferH3 && fallbackErr) } }()