Firefox 161 May Keep Retrying Encrypted DNS Over HTTP/3 When UDP Port 443 Is Blocked
One macOS system running Firefox 161 repeatedly tried HTTP/3 for encrypted DNS even though UDP traffic to port 443 was blocked. DNS still worked over TCP. The HTTP/3 preference path may be skipping the usual check for excluded destinations.
QUIC attempts continued even when DNS worked over TCP
A bug report on encrypted DNS in Firefox 161 was filed in Mozilla's public tracker at 9:38:51 a.m. on December 1.
Firefox can encrypt domain-name lookups with DNS over HTTPS (DoH). HTTP/3 runs over QUIC, which uses UDP. If a QUIC connection cannot be established, for example because UDP is blocked, the HTTP/3 specification (RFC 9114) recommends falling back to an HTTP version that uses TCP.
The reporter examined network logs from one macOS system running Firefox 161.0. A transparent proxy accepted traffic to UDP port 443 and immediately returned an error. The reporter said ordinary website connections fell back to TCP and excluded failed destinations from HTTP/3, but almost every DoH query came with a new QUIC attempt.
Over one business day, the logs showed about 2,200 QUIC connection attempts across four IP addresses for Cloudflare's Firefox DoH server, mozilla.cloudflare-dns.com. That works out to about 550 attempts per address. The median for the other 162 IP addresses was two attempts.
Of the QUIC attempts to the DoH server, 58% occurred within a second of a new web page connection, compared with 6% for randomly selected times. DoH worked over TCP throughout the observation period.
A successful DNS response can hide repeated failures. Falling back works for the current lookup, but Firefox may still choose the failed transport again on the next one.
The HTTP/3 preference path skips the usual exclusion check
Mozilla introduced a per-server HTTP/3 preference for DoH in Firefox 149. The reporter identified the preference for Cloudflare as a possible cause. As of December 1, Mozilla's published DoH provider configuration set http3First: true for the affected server.
In the Firefox 161 source code, AltSvcCache::LookupMapping looks up cached connection information. It removes an HTTP/3 mapping in conditions that include HTTP/3 being disabled or the destination being on the exclusion list.
When selecting an alternative HTTPS service with HTTP/3 allowed and preferred, AltSvcCache::GetAltServiceMapping creates and returns a new HTTP/3 mapping. The early return means it skips the usual exclusion check.
If each new DoH mapping selects HTTP/3 through this path, Firefox will retry QUIC without taking earlier failures into account. The reporter said this matched what the logs showed.
The reporter proposed falling through to the ordinary lookup for excluded destinations instead of applying the preference to them.
When the connection uses Happy Eyeballs, which tries multiple connection options, the function that adds destinations to the HTTP/3 exclusion list can return before adding them. The reporter did not know whether that feature was enabled on the observed system, so testing is needed to see whether adding the check would be sufficient. The bug was filed as UNCONFIRMED on December 1. The reporter also said they had yet to reproduce it with a fresh profile.
A proposed workaround keeps DoH enabled
For Firefox 161, the reporter suggested opening the configuration editor about:config and setting network.trr.allow_default_http3_first to false.
The Firefox 161 default is true. Setting it to false disables the default per-server HTTP/3 preference while leaving DoH enabled. If the separate setting network.trr.force_http3_first is enabled, it will still force an HTTP/3 preference.
The proposal lets users adjust the transport choice while keeping encrypted DNS protection.
Closing connections is also an issue on macOS
A November 27 report described page loads stalling for 15 to 45 seconds in Firefox 160.0.1 on macOS with a transparent proxy blocking UDP port 443 and a content filter in use. Happy Eyeballs v3 and HTTP/3 were enabled, and DoH was off. The stalls reportedly affected HTTP/2 traffic as well.
A Mozilla developer said closing a UDP socket can take about a second on macOS with a content filter and that Firefox was closing it on the network thread. The developer proposed excluding an HTTP/3 alternative service until the network changes if the destination is unreachable and validation fails.
If shutdown delays also occurred in the DoH case, repeated QUIC attempts could spend more time blocking network activity. The reporter raised the possibility but had not confirmed that the two issues share a cause.
Looking only at successful requests makes repeated failures easy to miss. The logs and code illustrate why the next connection needs to account for the previous failure.
KioskNews shows a cleaned-up reading view extracted from the publisher’s page — the original always lives on their site, not ours.
