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

Comments

Projects
None yet
3 participants
@bradfitz
Copy link
Member

commented Jun 28, 2015

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

This comment has been minimized.

Copy link

commented Jun 29, 2015

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

@pmarks-net

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2015

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

This comment has been minimized.

Copy link
Member Author

commented Jun 29, 2015

@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

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2015

@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.
You can’t perform that action at this time.