You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This program works fine on both Linux & Windows and does show below output, but not on Mac
[] lookup 10.256: no such host
[] lookup 10.256.1: no such host
[] lookup 10.10.256: no such host
[] lookup 10.10.256.1: no such host
[] lookup 10.10.10.256: no such host
What did you see instead?
[10.0.1.0] <nil>
[] lookup 10.256.1: no such host
[10.10.1.0] <nil>
[] lookup 10.10.256.1: no such host
[] lookup 10.10.10.256: no such host
The text was updated successfully, but these errors were encountered:
This is correct behaviour and it same for both linux and mac.
Plase see inet_aton(3) man page for more details:
The address supplied in cp can have one of the following forms:
....
a.b.c
Parts a and b specify the first two bytes of the binary address. Part c is interpreted
as a 16-bit value that defines the rightmost two bytes of the binary address.
This notation is suitable for specifying (outmoded) Class B network addresses.
a.b
Part a specifies the first byte of the binary address. Part b is interpreted as a 24-bit
value that defines the rightmost three bytes of the binary address. This notation is
suitable for specifying (outmoded) Class C network addresses.
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.
mikioh
changed the title
net: LookupHost show incorrect results on Mac (darwin)
net: LookupHost shows different results between GODEBUG=netdns=cgo and go
Nov 29, 2017
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
What did you do?
What did you expect to see?
This program works fine on both Linux & Windows and does show below output, but not on Mac
What did you see instead?
The text was updated successfully, but these errors were encountered: