net: use original argument in lookup error

Fixes #6324.

R=golang-dev, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13280049
This commit is contained in:
Russ Cox 2013-10-02 22:09:54 -04:00
parent e0867738fc
commit 94a6511b7f

View file

@ -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
}