aboutsummaryrefslogtreecommitdiff
path: root/src/net/dnsclient_unix.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-04-28 11:15:44 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-04-28 20:22:11 +0000
commit4d9bda51ff91f79944a12106b77315c9414b851a (patch)
treed8cdfcc79c7f7a11f1657965b105b9736ca387ae /src/net/dnsclient_unix.go
parent2cc27a7de9e7d14cb6702153688d02746c6a49ea (diff)
downloadgo-4d9bda51ff91f79944a12106b77315c9414b851a.tar.gz
go-4d9bda51ff91f79944a12106b77315c9414b851a.zip
net: append ":53" to DNS servers when reading resolv.conf
Avoids generating some redundant garbage from re-concatenating the same string for every DNS query. benchmark old allocs new allocs delta BenchmarkGoLookupIP-32 156 154 -1.28% BenchmarkGoLookupIPNoSuchHost-32 456 446 -2.19% BenchmarkGoLookupIPWithBrokenNameServer-32 577 564 -2.25% benchmark old bytes new bytes delta BenchmarkGoLookupIP-32 10873 10824 -0.45% BenchmarkGoLookupIPNoSuchHost-32 43303 43140 -0.38% BenchmarkGoLookupIPWithBrokenNameServer-32 46824 46616 -0.44% Update #15473. Change-Id: I3b0173dfedf31bd08eaea1069968b416850864a1 Reviewed-on: https://go-review.googlesource.com/22556 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/dnsclient_unix.go')
-rw-r--r--src/net/dnsclient_unix.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go
index 1adfda7b06..12d12eba9c 100644
--- a/src/net/dnsclient_unix.go
+++ b/src/net/dnsclient_unix.go
@@ -190,7 +190,6 @@ func tryOneName(ctx context.Context, cfg *dnsConfig, name string, qtype uint16)
var lastErr error
for i := 0; i < cfg.attempts; i++ {
for _, server := range cfg.servers {
- server = JoinHostPort(server, "53")
msg, err := exchange(ctx, server, name, qtype)
if err != nil {
lastErr = &DNSError{