DnsResolver does not handle misconfigured DNS servers
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
https://github.com/dotnet/runtime/blob/26b900856a2f12c4c7126827cb3019accba8f17c/src/libraries/System.Net.NameResolution/src/System/Net/DnsResolverPal.Windows.cs#L125-L136
For some reason there are servers in the wild that return all answers in ADDTIONAL section, not ANSWER. From reports in my app, it seemed to mostly be ISP DNS servers, but they do exist in the wild.
Since Windows GetAddrInfoExW does handle such responses, DnsResolver should probably pretend they're valid too and behave as if the results were in ANSWER.
cc @rzikm this was one of the weird behaviours I noticed when doing DNS for my app. I think the other ones I recall should be handled by DnsQueryEx already (I was using a library that did requests from scratch).
Contributor guide
Assessment
This issue has not been assessed yet.