mirror of https://github.com/golang/go.git
return errNoSuchHost
This commit is contained in:
parent
0266671e3d
commit
ff756a73d8
|
|
@ -556,9 +556,13 @@ func (r *Resolver) goLookupHostOrder(ctx context.Context, name string, order hos
|
|||
if order == hostLookupFilesDNS || order == hostLookupFiles {
|
||||
// Use entries from /etc/hosts if they match.
|
||||
addrs, _ = lookupStaticHost(name)
|
||||
if len(addrs) > 0 || order == hostLookupFiles {
|
||||
if len(addrs) > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if order == hostLookupFiles {
|
||||
return nil, &DNSError{Err: errNoSuchHost.Error(), Name: name, IsNotFound: true}
|
||||
}
|
||||
}
|
||||
ips, _, err := r.goLookupIPCNAMEOrder(ctx, "ip", name, order, conf)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue