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 <bjboreham@gmail.com>
This commit is contained in:
parent
576ee4d309
commit
968f657eaa
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue