fix: filter link-local (APIPA) addresses from DNS resolution results#8181
Merged
Arkatufus merged 5 commits intoApr 24, 2026
Merged
Conversation
…kkadotnet#8178) On Windows hosts with multiple network adapters, Dns.GetHostEntryAsync can return APIPA (169.254.x.x) addresses from DNS results when a secondary NIC fails DHCP and registers the link-local address via dynamic DNS. Previously ResolveNameAsync unconditionally selected the last matching address in the DNS result list. When the last entry was a link-local address, the transport would bind to or attempt to connect to an unreachable address, breaking cluster formation. This fix: - Filters out IPv4 link-local (169.254.0.0/16) and IPv6 link-local (fe80::/10) addresses - Falls back to the original unfiltered behavior if all candidates are filtered, preserving backward compatibility - Switches from LastOrDefault to FirstOrDefault for the filtered list, preferring the DNS server's primary result order - Preserves loopback addresses (localhost still works normally) Closes akkadotnet#8178
Aaronontheweb
commented
Apr 23, 2026
Aaronontheweb
left a comment
Member
Author
There was a problem hiding this comment.
Needs some cleanup
…ug logging - FilterLinkLocalAddresses returns IEnumerable<IPAddress> instead of IPAddress[] - Collapse 8 individual Fact tests into a single Theory with MemberData - Add debug-level logging when link-local addresses are filtered from DNS results
Aaronontheweb
commented
Apr 23, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8178
Changes
On Windows hosts with multiple network adapters, Dns.GetHostEntryAsync can return APIPA (169.254.x.x) addresses from DNS results when a secondary NIC fails DHCP and registers the link-local address via dynamic DNS.
Previously ResolveNameAsync unconditionally selected the last matching address in the DNS result list. When the last entry was a link-local address, the transport would bind to or attempt to connect to an unreachable address, breaking cluster formation.
This fix:
Checklist