diff options
author | Russ Cox <rsc@golang.org> | 2016-01-08 17:17:53 +0000 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2016-01-08 17:18:00 +0000 |
commit | a120beaa8db6b723c120c8d3bf3324dfa503cb2d (patch) | |
tree | 0b0556382322664869190e78aac0c1ddf96044a1 /src/net/lookup.go | |
parent | beb1741ae380d4e196f9d6e2e720fc0dc007ef00 (diff) | |
download | go-a120beaa8db6b723c120c8d3bf3324dfa503cb2d.tar.gz go-a120beaa8db6b723c120c8d3bf3324dfa503cb2d.zip |
Revert "net: ensure that malformed domain names report a consistent error"
This reverts commit bb8c2e19a7fe2ca2283eca44dba2047c9f4307fe.
Change-Id: I9bc089e9f2296805ef055b98e8c86ba73af30226
Reviewed-on: https://go-review.googlesource.com/18439
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/net/lookup.go')
-rw-r--r-- | src/net/lookup.go | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/net/lookup.go b/src/net/lookup.go index b5d77e02ea..7aa111ba92 100644 --- a/src/net/lookup.go +++ b/src/net/lookup.go @@ -33,9 +33,6 @@ func LookupHost(host string) (addrs []string, err error) { if ip := ParseIP(host); ip != nil { return []string{host}, nil } - if !isDomainName(host) { - return nil, &DNSError{Err: "invalid domain name", Name: host} - } return lookupHost(host) } @@ -50,9 +47,6 @@ func LookupIP(host string) (ips []IP, err error) { if ip := ParseIP(host); ip != nil { return []IP{ip}, nil } - if !isDomainName(host) { - return nil, &DNSError{Err: "invalid domain name", Name: host} - } addrs, err := lookupIPMerge(host) if err != nil { return @@ -152,9 +146,6 @@ func LookupPort(network, service string) (port int, err error) { // LookupHost or LookupIP directly; both take care of resolving // the canonical name as part of the lookup. func LookupCNAME(name string) (cname string, err error) { - if !isDomainName(name) { - return "", &DNSError{Err: "invalid domain name", Name: name} - } return lookupCNAME(name) } @@ -168,33 +159,21 @@ func LookupCNAME(name string) (cname string, err error) { // publishing SRV records under non-standard names, if both service // and proto are empty strings, LookupSRV looks up name directly. func LookupSRV(service, proto, name string) (cname string, addrs []*SRV, err error) { - if !isDomainName(name) { - return "", nil, &DNSError{Err: "invalid domain name", Name: name} - } return lookupSRV(service, proto, name) } // LookupMX returns the DNS MX records for the given domain name sorted by preference. func LookupMX(name string) (mxs []*MX, err error) { - if !isDomainName(name) { - return nil, &DNSError{Err: "invalid domain name", Name: name} - } return lookupMX(name) } // LookupNS returns the DNS NS records for the given domain name. func LookupNS(name string) (nss []*NS, err error) { - if !isDomainName(name) { - return nil, &DNSError{Err: "invalid domain name", Name: name} - } return lookupNS(name) } // LookupTXT returns the DNS TXT records for the given domain name. func LookupTXT(name string) (txts []string, err error) { - if !isDomainName(name) { - return nil, &DNSError{Err: "invalid domain name", Name: name} - } return lookupTXT(name) } |