From 968f657eaa7417bf15aafc0fb1156409afa41807 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 13 Sep 2018 10:58:38 +0100 Subject: [PATCH] Stop removing the final dot from rooted DNS names (#4586) Removing a final dot changes the meaning of the name and can cause extra DNS lookups as the resolver traverses its search path. Signed-off-by: Bryan Boreham --- discovery/dns/dns.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/discovery/dns/dns.go b/discovery/dns/dns.go index 17e7dad0e..61dd54b4c 100644 --- a/discovery/dns/dns.go +++ b/discovery/dns/dns.go @@ -181,9 +181,6 @@ func (d *Discovery) refresh(ctx context.Context, name string, ch chan<- []*targe target := model.LabelValue("") switch addr := record.(type) { case *dns.SRV: - // Remove the final dot from rooted DNS names to make them look more usual. - addr.Target = strings.TrimRight(addr.Target, ".") - target = hostPort(addr.Target, int(addr.Port)) case *dns.A: target = hostPort(addr.A.String(), d.port)