]> Cypherpunks repositories - gostls13.git/commit
net: add mechanisms to force go or cgo lookup, and to debug default strategy
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 25 Jun 2015 10:52:54 +0000 (12:52 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 9 Jul 2015 22:19:41 +0000 (22:19 +0000)
commitb615ad8fd57f9394db14e403d12061c369379c52
tree62bceef37507785526b4f5ff64811c56db06826c
parent4c332508f92cc39eaa4c10ed005a615776280a04
net: add mechanisms to force go or cgo lookup, and to debug default strategy

GODEBUG=netdns=1 prints a one-time strategy decision. (cgo or go DNS lookups)
GODEBUG=netdns=2 prints the per-lookup strategy as a function of the hostname.

The new "netcgo" build tag forces cgo DNS lookups.

GODEBUG=netdns=go (or existing build tag "netgo") forces Go DNS resolution.
GODEBUG=netdns=cgo (or new build tag "netcgo") forces libc DNS resolution.

Options can be combined with e.g. GODEBUG=netdns=go+1 or GODEBUG=netdns=2+cgo.

Fixes #11322
Fixes #11450

Change-Id: I7a67e9f759fd0a02320e7803f9ded1638b19e861
Reviewed-on: https://go-review.googlesource.com/11584
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/net/cgo_stub.go
src/net/conf.go
src/net/conf_netcgo.go [new file with mode: 0644]
src/net/conf_test.go
src/net/net.go
src/net/parse.go
src/net/parse_test.go