diff --git a/net/dns/resolver/tsdns.go b/net/dns/resolver/tsdns.go index 4331fcdb6..b4d4b7c1a 100644 --- a/net/dns/resolver/tsdns.go +++ b/net/dns/resolver/tsdns.go @@ -598,11 +598,6 @@ func marshalResponse(resp *response) ([]byte, error) { // dr._dns-sd._udp.. // lb._dns-sd._udp.. func hasRDNSBonjourPrefix(name dnsname.FQDN) bool { - // Even the shortest name containing a Bonjour prefix is long, - // so check length (cheap) and bail early if possible. - if len(name) < len("*._dns-sd._udp.0.0.0.0.in-addr.arpa.") { - return false - } s := name.WithTrailingDot() dot := strings.IndexByte(s, '.') if dot == -1 { diff --git a/net/dns/resolver/tsdns_test.go b/net/dns/resolver/tsdns_test.go index 900dc9682..5809ce798 100644 --- a/net/dns/resolver/tsdns_test.go +++ b/net/dns/resolver/tsdns_test.go @@ -985,6 +985,7 @@ func TestTrimRDNSBonjourPrefix(t *testing.T) { {"lb._dns-sd._udp.0.10.20.172.in-addr.arpa.", true}, {"qq._dns-sd._udp.0.10.20.172.in-addr.arpa.", false}, {"0.10.20.172.in-addr.arpa.", false}, + {"lb._dns-sd._udp.ts-dns.test.", true}, } for _, test := range tests {