Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: provide mechanism to force DNS via cgo #11450

Closed
bradfitz opened this issue Jun 28, 2015 · 4 comments
Closed

net: provide mechanism to force DNS via cgo #11450

bradfitz opened this issue Jun 28, 2015 · 4 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

We should probably provide a mechanism in Go 1.5 to let users force the use of cgo/libc for DNS resolution. I'm afraid the pure Go solution will have problems for some users, and saying "modifying your nsswitch.conf or resolv.conf to be 'complicated enough'" isn't a great answer.

So, two questions:

  1. should we do this? (I think yes)
  2. which mechanism? env var? build tag? (I'm undecided).

/cc @pmarks-net @mikioh @ianlancetaylor @rsc

@bradfitz bradfitz added this to the Go1.5 milestone Jun 28, 2015
@gopherbot
Copy link

CL https://golang.org/cl/11584 mentions this issue.

@pmarks-net
Copy link
Contributor

If we're talking about #10552, then I think an environment variable would be more useful than a compile-time option, because often the people affected will not be the application developers.

That said, it's better to ship a correct algorithm, than an incorrect one with an easy workaround.

@bradfitz
Copy link
Contributor Author

@rsc had reservations about an environment variable. My first version of the CL used an environment variable, but it's now a build tag.

@bradfitz
Copy link
Contributor Author

@rsc says:

if we need an explicit environment signal, can we reuse GODEBUG instead of adding a new one? GODEBUG=netdns=1 for tracing, GODEBUG=netdns=cgo for cgo, and GODEBUG=netdns=cgo+1 for cgo and tracing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants