net: don't avoid resolving .local addresses

.local addresses are used by things like Kubernetes and Weave DNS; Go
should not avoid resolving them.

This is a partial revert of https://golang.org/cl/21328 which was too
strict of an interpretation of RFC 6762.

Fixes #16739

Change-Id: I349415b4eab5d61240dd18217bd95dc7d2105cd5
Reviewed-on: https://go-review.googlesource.com/27250
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Tom Wilkie 2016-08-17 10:13:03 +01:00 committed by Brad Fitzpatrick
parent 73fdba2601
commit 289df4e6e6
2 changed files with 9 additions and 7 deletions

View file

@ -112,10 +112,11 @@ func TestAvoidDNSName(t *testing.T) {
{"foo.ONION", true},
{"foo.ONION.", true},
{"foo.local.", true},
{"foo.local", true},
{"foo.LOCAL", true},
{"foo.LOCAL.", true},
// But do resolve *.local address; Issue 16739
{"foo.local.", false},
{"foo.local", false},
{"foo.LOCAL", false},
{"foo.LOCAL.", false},
{"", true}, // will be rejected earlier too