fd.Close()
}
-func TestLookupCNAME(t *testing.T) {
- if testing.Short() || !*testExternal {
- t.Logf("skipping test to avoid external network")
- return
- }
- cname, err := LookupCNAME("www.google.com")
- if !strings.HasSuffix(cname, ".l.google.com.") || err != nil {
- t.Errorf(`LookupCNAME("www.google.com.") = %q, %v, want "*.l.google.com.", nil`, cname, err)
- }
-}
-
var googleaddrsipv4 = []string{
"%d.%d.%d.%d:80",
"www.google.com:80",
import (
"flag"
+ "strings"
"testing"
)
}
}
+func TestLookupIANACNAME(t *testing.T) {
+ if testing.Short() || !*testExternal {
+ t.Logf("skipping test to avoid external network")
+ return
+ }
+ cname, err := LookupCNAME("www.iana.org")
+ if !strings.HasSuffix(cname, ".icann.org.") || err != nil {
+ t.Errorf(`LookupCNAME("www.iana.org.") = %q, %v, want "*.icann.org.", nil`, cname, err)
+ }
+}
+
var revAddrTests = []struct {
Addr string
Reverse string