Skip to content

Commit

Permalink
net: fix LookupCNAME on Plan 9
Browse files Browse the repository at this point in the history
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 golang#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]>
  • Loading branch information
0intro committed Aug 8, 2017
1 parent e0e7c03 commit bd3dc9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net/lookup_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bd3dc9d

Please sign in to comment.