]> Cypherpunks repositories - gostls13.git/commit
net: allow Resolver to use a custom dialer
authorMatt Harden <matt.harden@gmail.com>
Mon, 20 Feb 2017 13:58:55 +0000 (05:58 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 12 May 2017 18:08:12 +0000 (18:08 +0000)
commit380aa884b8b2935137eee266d0a44e9083fae71f
tree9bfc6df0b2812945abbb77dfe7fd505fff93cbe8
parent3b5637ff2bd5c03479780995e7a35c48222157c1
net: allow Resolver to use a custom dialer

In some cases it is desirable to customize the way the DNS server is
contacted, for instance to use a specific LocalAddr. While most
operating-system level resolvers do not allow this, we have the
opportunity to do so with the Go resolver. Most of the code was
already in place to allow tests to override the dialer. This exposes
that functionality, and as a side effect eliminates the need for a
testing hook.

Fixes #17404

Change-Id: I1c5e570f8edbcf630090f8ec6feb52e379e3e5c0
Reviewed-on: https://go-review.googlesource.com/37260
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/go/build/deps_test.go
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/lookup.go
src/net/lookup_unix.go