{
"ErrorMessage": "LocalhostSubdomain_RespectsAddressFamily",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
System.Net.Sockets.SocketException : hostname nor servname provided, or not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntryCore(String hostName, AddressFamily addressFamily, ...)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress, AddressFamily family)
Each Android job has exactly 1 failure per test (the test has 2 InlineData values: InterNetwork and InterNetworkV6), suggesting only one address family variant fails per run.
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943
Build error leg or test failing: System.Net.NameResolution.Tests.GetHostEntryTest.DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamily, System.Net.NameResolution.Tests.GetHostAddressesTest.DnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamily
Error Message
Fill the error message using step by step known issues guidance.
{ "ErrorMessage": "LocalhostSubdomain_RespectsAddressFamily", "ErrorPattern": "", "BuildRetry": false, "ExcludeConsoleLog": false }Description
The
DnsGetHostEntry_LocalhostSubdomain_RespectsAddressFamilyandDnsGetHostAddresses_LocalhostSubdomain_RespectsAddressFamilytests (introduced in PR #123076 for RFC 6761 localhost subdomain handling) consistently fail on Android CI (windows.11.amd64.android.openqueue).Error
Analysis
Dns.GetHostEntry("test.localhost", AddressFamily.InterNetwork)(orInterNetworkV6)."test.localhost"first, then falls back to resolving plain"localhost"with the sameAddressFamily.GetHostEntryOrAddressesCorein the stack trace confirms the fallback triggers but also fails.getaddrinfo("localhost", ..., ai_family)with a specific address family (AF_INETorAF_INET6). On Android, this may fail (EAI_NONAME) whilegetaddrinfo("localhost", ..., AF_UNSPEC)succeeds.AddressFamily.Unspecified(e.g.ReturnsLoopback) pass on Android.[OuterLoop]tests that callDns.GetHostEntry("localhost", AddressFamily.InterNetwork)directly to confirm if family-specific localhost resolution works on Android in general.CI Data (last 14 days, main branch)
Each Android job has exactly 1 failure per test (the test has 2 InlineData values: InterNetwork and InterNetworkV6), suggesting only one address family variant fails per run.
Console log example
https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-heads-main-76f79e897d5246b58a/System.Net.NameResolution.Functional.Tests/1/console.858b3560.log?helixlogtype=result
Possible fixes
"localhost"withAddressFamily.Unspecifiedand then filter results by the requested family.getaddrinfo("localhost", AF_INET/AF_INET6)is expected to work on Android and fix the emulator setup.Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1304943
Error message validated:
[LocalhostSubdomain_RespectsAddressFamily]Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 2/23/2026 12:30:22 PM UTC
Report
Summary