Uh oh!
There was an error while loading. Please reload this page.
Expand Windows DNS sync-query detection for inline-completing names - #130411
Conversation
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Windows System.Net.NameResolution DnsQueryEx workaround by expanding the set of query names treated as “known to complete synchronously” on affected Windows versions, and extends the existing regression test to exercise those names through both sync/async resolver entry points.
Changes:
- Replace the
localhost-only fast-path withIsSynchronouslyCompletingQueryName, including IP literal detection and additional special-case names. - Route those names directly through the synchronous DnsQueryEx path when running async on pre-22000 Windows versions.
- Expand the Windows regression test to cover the additional “synchronously completing” names.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/libraries/System.Net.NameResolution/src/System/Net/DnsResolverPal.Windows.cs | Broaden the pre-22000 async inline-completion workaround to a wider set of names via a new predicate. |
| src/libraries/System.Net.NameResolution/tests/FunctionalTests/DnsResolverTest.cs | Expand the existing Windows regression test to cover the broader set of synchronously-completing names. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MichalPetryka
left a comment
There was a problem hiding this comment.
Should we add an assert that we never got null and a memory leak here?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…n true on hostname failure, fix test data Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
…tion test Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
rzikm
commented
Jul 13, 2026
/ba-g System.Text.Json failures are unrelated |
Uh oh!
There was an error while loading. Please reload this page.
…130411) <!-- --> This broadens the Windows `DnsResolver` workaround for pre-22000 `DnsQueryEx` inline completion so it covers the full set of names the OS team identified as synchronously completing, not just `localhost`. The change keeps the existing async path for all other names and avoids the extra `DNS_QUERY_NO_WIRE_QUERY` probe. - **Behavior** - Route these names directly through the synchronous path on affected Windows versions: - IP literals - machine hostname - `loopback` - `localhost` - `..DnsServers` - `..localmachine` - **Implementation** - Replace the `localhost`-only check with a broader predicate for synchronously completing names. - Use `IPAddress.IsValid(...)` for allocation-free IP literal detection. - Compare against the current hostname without process-wide caching. - If hostname lookup fails, fall back to the normal async path rather than introducing a new failure mode. - **Regression coverage** - Expand the existing Windows regression test to cover the added synchronous-completion cases through both sync and async entry points. ```csharp if (IPAddress.IsValid(name)) { return true; } ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
This broadens the Windows
DnsResolverworkaround for pre-22000DnsQueryExinline completion so it covers the full set of names the OS team identified as synchronously completing, not justlocalhost. The change keeps the existing async path for all other names and avoids the extraDNS_QUERY_NO_WIRE_QUERYprobe.Behavior
loopbacklocalhost..DnsServers..localmachineImplementation
localhost-only check with a broader predicate for synchronously completing names.IPAddress.IsValid(...)for allocation-free IP literal detection.Regression coverage