From: Russ Cox Date: Thu, 3 Oct 2013 02:09:54 +0000 (-0400) Subject: net: use original argument in lookup error X-Git-Tag: go1.2rc2~83 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=94a6511b7f54501116144e529f9e0e7a1cbb5e87;p=gostls13.git net: use original argument in lookup error Fixes #6324. R=golang-dev, iant, mikioh.mikioh CC=golang-dev https://golang.org/cl/13280049 --- diff --git a/src/pkg/net/dnsclient_unix.go b/src/pkg/net/dnsclient_unix.go index f42e9d321f..16cf420dcd 100644 --- a/src/pkg/net/dnsclient_unix.go +++ b/src/pkg/net/dnsclient_unix.go @@ -211,6 +211,12 @@ func lookup(name string, qtype uint16) (cname string, addrs []dnsRR, err error) if err == nil { return } + if e, ok := err.(*DNSError); ok { + // Show original name passed to lookup, not suffixed one. + // In general we might have tried many suffixes; showing + // just one is misleading. See also golang.org/issue/6324. + e.Name = name + } return }