News for hackers. Stuff that matters.
Re:Go 1.7 is released by Scaevolus on Monday August 15, 2016 @09:11PM (#12294814)
Go generally links to libc to use the system's getaddrinfo-- some OSes override it to do special things with dynamically discovered hosts on local networks, interfacing with LDAP/AD, etc.

If you use `CGO_ENABLED=0 go build`, it should make a statically linked executable.

Re:Go 1.7 is released by kyrra on Monday August 15, 2016 @10:52PM (#12295224)
I don't believe that has been true for a few releases now. I believe go defaults to a pure Go resolver implementation now. You have to force enable the cgo resolver.

https://golang.org/pkg/net/

Re:Go 1.7 is released by f2f on Monday August 15, 2016 @11:26PM (#12295342)
from the same page:

"When cgo is available, the cgo-based resolver is used instead under a variety of conditions: on systems that do not let programs make direct DNS requests (OS X), when the LOCALDOMAIN environment variable is present (even if empty), when the RES_OPTIONS or HOSTALIASES environment variable is non-empty, when the ASR_CONFIG environment variable is non-empty (OpenBSD only), when /etc/resolv.conf or /etc/nsswitch.conf specify the use of features that the Go resolver does not implement, and when the name being looked up ends in .local or is an mDNS name."

Re:Go 1.7 is released by voltagex_ on Monday August 15, 2016 @10:43PM (#12295187)
By some OSes, you mean any Linux distro with Avahi installed, right? I'm assuming getaddrinfo checks NSS for where to look up hostnames.

I should also check how Windows with Bonjour behaves.