Commit bd3dc9d6 authored by David du Colombier's avatar David du Colombier

net: fix LookupCNAME on Plan 9

Looking up a nonexistent CNAME record on an existing
domain on Plan 9 can return either a "dns failure"
error or a "resource does not exist" error.

Fixes #21335.

Change-Id: Iead8ed4fe3167db06adb4ab7797c52c7efc3ff89
Reviewed-on: https://go-review.googlesource.com/53670
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarAvelino <t@avelino.xxx>
parent e0e7c03d
......@@ -198,7 +198,7 @@ func (*Resolver) lookupPort(ctx context.Context, network, service string) (port
func (*Resolver) lookupCNAME(ctx context.Context, name string) (cname string, err error) {
lines, err := queryDNS(ctx, name, "cname")
if err != nil {
if stringsHasSuffix(err.Error(), "dns failure") {
if stringsHasSuffix(err.Error(), "dns failure") || stringsHasSuffix(err.Error(), "resource does not exist; negrcode 0") {
cname = name + "."
err = nil
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment