Skip to content

Commit bd3dc9d

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Avelino <[email protected]>
1 parent e0e7c03 commit bd3dc9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/lookup_plan9.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func (*Resolver) lookupPort(ctx context.Context, network, service string) (port
198198
func (*Resolver) lookupCNAME(ctx context.Context, name string) (cname string, err error) {
199199
lines, err := queryDNS(ctx, name, "cname")
200200
if err != nil {
201-
if stringsHasSuffix(err.Error(), "dns failure") {
201+
if stringsHasSuffix(err.Error(), "dns failure") || stringsHasSuffix(err.Error(), "resource does not exist; negrcode 0") {
202202
cname = name + "."
203203
err = nil
204204
}

0 commit comments

Comments
 (0)