Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for avoidDNS (0.11 sec)

  1. src/net/dnsclient_unix.go

    		err.Name = name
    	}
    	return dnsmessage.Parser{}, "", err
    }
    
    // avoidDNS reports whether this is a hostname for which we should not
    // use DNS. Currently this includes only .onion, per RFC 7686. See
    // golang.org/issue/13705. Does not cover .local names (RFC 6762),
    // see golang.org/issue/16739.
    func avoidDNS(name string) bool {
    	if name == "" {
    		return true
    	}
    	if name[len(name)-1] == '.' {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  2. src/net/dnsclient_unix_test.go

    		// private.
    		{"local", false},
    		{"onion", false},
    		{"local.", false},
    		{"onion.", false},
    	}
    	for _, tt := range tests {
    		got := avoidDNS(tt.name)
    		if got != tt.avoid {
    			t.Errorf("avoidDNS(%q) = %v; want %v", tt.name, got, tt.avoid)
    		}
    	}
    }
    
    func TestNameListAvoidDNS(t *testing.T) {
    	c := &dnsConfig{search: []string{"go.dev.", "onion."}}
    	got := c.nameList("www")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 72.4K bytes
    - Viewed (0)
Back to top