diff --git a/pkg/discovery/dns/resolver.go b/pkg/discovery/dns/resolver.go index b7863f62a41..3c139089af6 100644 --- a/pkg/discovery/dns/resolver.go +++ b/pkg/discovery/dns/resolver.go @@ -5,7 +5,6 @@ package dns import ( "context" - "fmt" "net" "strconv" "strings" @@ -109,8 +108,9 @@ func (s *dnsSD) Resolve(ctx context.Context, name string, qtype QType) ([]string } if qtype == SRVNoA { - fmt.Printf("Hello: %s", rec.Target) - res = append(res, appendScheme(scheme, net.JoinHostPort(rec.Target, resPort))) + // Remove the final dot from rooted DNS names to make them look more usual. + target := strings.TrimRight(rec.Target, ".") + res = append(res, appendScheme(scheme, net.JoinHostPort(target, resPort))) continue } // Do A lookup for the domain in SRV answer.