In bug 1852900 we added the ability for Firefox to use the native OS resolver for HTTPS record resolution. However, we discovered that DnsQuery_A doesn't return a proper result on windows 10. Here's the report we made to microsoft: --- When using the DNS APIs in Windows we've discovered some unexpected behaviour that's only happening on Windows 10. In particular it's about DnsQuery_A [1] being used to resolve HTTPS records. The following snippet of code works correctly on Windows 11, but on Windows 10 the call to DnsQuery_A returns ERROR_SUCCESS, but the result is still NULL. I have checked Wireshark, and the HTTPS request is sent and a response is received. ```cpp PDNS_RECORD result = nullptr; DNS_STATUS status = DnsQuery_A(host.get(), nsIDNSService::RESOLVE_TYPE_HTTPSSVC /* 65 */, DNS_QUERY_STANDARD, nullptr, &result, nullptr); if (status != ERROR_SUCCESS) { LOG("DnsQuery_A failed with error: %ld\n", status); return NS_ERROR_UNKNOWN_HOST; } LOG("result %p", result); ``` While I don't expect the Windows 10 implementation to know how to parse HTTPS/SVCB records I think it should still let me access the response as DNS_UNKNOWN_DATA, and that the response shouldn't be null. Is this a known issue with DnsQuery_A or otherwise a limitation that is not documented? For reference, my OS version is Windows 10 Pro / OS build 19045.3693 / Feature Experience Pack 1000.19053.1000.0 [1] https://learn.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsquery_a --- Assuming that Microsoft will eventually fix the issue on windows 10, we should add a pref that allows the resolution to happen.
Bug 1873461 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
In bug 1852900 we added the ability for Firefox to use the native OS resolver for HTTPS record resolution. However, we discovered that DnsQuery_A doesn't return a proper result on windows 10. Here's the report we made to microsoft: --- When using the DNS APIs in Windows we've discovered some unexpected behaviour that's only happening on Windows 10. In particular it's about DnsQuery_A [1] being used to resolve HTTPS records. The following snippet of code works correctly on Windows 11, but on Windows 10 the call to DnsQuery_A returns ERROR_SUCCESS, but the result is still NULL. I have checked Wireshark, and the HTTPS request is sent and a response is received. ```cpp PDNS_RECORD result = nullptr; DNS_STATUS status = DnsQuery_A(host.get(), nsIDNSService::RESOLVE_TYPE_HTTPSSVC /* 65 */, DNS_QUERY_STANDARD, nullptr, &result, nullptr); if (status != ERROR_SUCCESS) { LOG("DnsQuery_A failed with error: %ld\n", status); return NS_ERROR_UNKNOWN_HOST; } LOG("result %p", result); ``` While I don't expect the Windows 10 implementation to know how to parse HTTPS/SVCB records I think it should still let me access the response as DNS_UNKNOWN_DATA, and that the response shouldn't be null. Is this a known issue with DnsQuery_A or otherwise a limitation that is not documented? For reference, my OS version is Windows 10 Pro / OS build 19045.3693 / Feature Experience Pack 1000.19053.1000.0 [1] https://learn.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsquery_a --- Assuming that Microsoft will eventually fix the issue on windows 10, we should add a pref that allows the resolution to happen, as it's currently hardcoded to only allow windows11 https://searchfox.org/mozilla-central/rev/f961e5f2a22f4d41733545190892296e64c06858/netwerk/dns/nsHostResolver.cpp#238 ```cpp sNativeHTTPSSupported = mozilla::IsWin11OrLater(); ```