Skip to content

Handle empty DNS reply without error as NOERROR

Daniel Winzen requested to merge DanWin/tor:empty-dns into main

When after DNS resolution we don't receive an error from a relay, the response cell contains IPv4 and/or IPv6 addresses. However, when we only want to retrieve one of these (e.g. A lookup), and the response cell contains only the other type, this is currently handled as an error, resulting in an NXDOMAIN response. This prevents further queries for the other type (AAAA lookup), making IPv6/IPv4 only services unreachable in programs that use DNSPort for resolution. This merge request changes the current behavior to handle such cases gracefully and send NOERROR response instead, so that programs will initiate a second lookup for the other type.

Fixes #40248

Merge request reports