Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
net: LookupHost shows different results between GODEBUG=netdns=cgo and go #22902
What version of Go are you using (
This is correct behaviour and it same for both linux and mac.
When GODEBUG=netdns=cgo, general name resolution depends on external functionality provided by userspace stuff such as libc (the behavior is different between implementations, for example, libc on BSD variants vs. libc on macOS/iOS vs. glibc vs. Windows API vs. Plan 9), and when GODEBUG=netdns=go, DNS name resolution uses only package internal helpers.
I think it's fine to align IP literal handling with the existing GODEUG=netdns=go behavior basically (because no one never uses classful IPv4 routing), though I'm still wondering whether we should deal with IP address synthesis as described in RFC 7050. Without application context, it's very hard to determine what's correct and what's not.
A friend: #20790