5 ms·
The downside to Go shipping it's own implementation of DNS resolution is that on systems that support far more rich set of DNS options (such as split DNS based
by X-Istence 6y ago
The downside to Go shipping it's own implementation of DNS resolution is that on systems that support far more rich set of DNS options (such as split DNS based upon hostnames in macOS) is that it doesn't work if the binary is built with a pure Go implementation.
That leaves users annoyed, because sending all DNS into a VPN tunnel is not always an option.
- yencabulator 6y agoIf cgo is enabled (the usual case), Go uses libc for DNS if the configuration looks exotic enough that the pure-Go code wouldn't give the same results. https://golang.org/pkg/net/#hdr-Name_Resolution https://golang.org/pkg/net/#hdr-Name_Resolution
- ArchOversight 6y agoThis is a long standing issue in various open source projects that use Go, where they want to ship static binaries. Most recently, this happened with Concourse and it's Fly binary: https://github.com/concourse/concourse/issues/3691 https://github.com/concourse/concourse/issues/3691 The developers don't want to use CGO, or when they do use CGO they disable the net part... and now stuff doesn't work. Projects have to specifically build with cgo enabled on macOS, or else it fails.