From acee998df69777b2f7e6b7634a87fd0031ff96f4 Mon Sep 17 00:00:00 2001 From: Matt Berther Date: Tue, 1 Dec 2020 02:32:15 -0700 Subject: [PATCH] CNAME responses can occur with "Type: A" dns_sd_config requests (#8216) Signed-off-by: Matt Berther --- discovery/dns/dns.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discovery/dns/dns.go b/discovery/dns/dns.go index d86ba945a..9aa07dcae 100644 --- a/discovery/dns/dns.go +++ b/discovery/dns/dns.go @@ -211,8 +211,10 @@ func (d *Discovery) refreshOne(ctx context.Context, name string, ch chan<- *targ target = hostPort(addr.A.String(), d.port) case *dns.AAAA: target = hostPort(addr.AAAA.String(), d.port) + case *dns.CNAME: + // CNAME responses can occur with "Type: A" dns_sd_config requests. default: - level.Warn(d.logger).Log("msg", "Invalid SRV record", "record", record) + level.Warn(d.logger).Log("msg", "Invalid record", "record", record) continue } tg.Targets = append(tg.Targets, model.LabelSet{