Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: add mechanism to dump DNS strategy #11322
In Go 1.5, the net package will prefer to do its own DNS lookups, rather than using cgo if the nsswitch.conf and resolv.conf files (which are now parsed) permit.
Users will inevitably find problems with DNS resolution (as they have in every release in the past: whether it's with fd exhaustion, or the results themselves), and we'll need a way to debug which of the two paths users' code is going. We don't have such a mechanism now.
Perhaps a GODEBUG environment variable key ("GODEBUG=netdns=1") which causes the net package to print its decisions about how it'll do DNS, at least the first time.