-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.16.0-dev.1316+181b25ce4
Steps to Reproduce and Observed Behavior
When using HostName.lookup in a kubernetes environment it's returning NameServerFailure where other programs successfully resolve DNS. The one specific difference with other things I've tested is setting AI_ADDRCONFIG in getnameinfo.
Expected Behavior
I'd expect it to resolve the addresses instead of returning an error.
I'm suggesting the following, but I'm not sure of the cross-platform repercussions:
--- a/lib/std/Io/Threaded.zig
+++ b/lib/std/Io/Threaded.zig
@@ -4924,7 +4924,7 @@ fn netLookupPosix(
const port_c = std.fmt.bufPrintZ(&port_buffer, "{d}", .{options.port}) catch unreachable;
const hints: posix.addrinfo = .{
- .flags = .{ .NUMERICSERV = true },
+ .flags = .{ .NUMERICSERV = true, .ADDRCONFIG = true },
.family = posix.AF.UNSPEC,
.socktype = posix.SOCK.STREAM,
.protocol = posix.IPPROTO.TCP,
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior