|
|
@ -1429,18 +1429,16 @@ func (d *DNSServer) serviceNodeRecords(cfg *dnsConfig, dc string, nodes structs.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
handled[records[0].String()] = struct{}{}
|
|
|
|
handled[records[0].String()] = struct{}{}
|
|
|
|
|
|
|
|
|
|
|
|
if records != nil {
|
|
|
|
switch records[0].(type) {
|
|
|
|
switch records[0].(type) {
|
|
|
|
case *dns.CNAME:
|
|
|
|
case *dns.CNAME:
|
|
|
|
// keep track of the first CNAME + associated RRs but don't add to the resp.Answer yet
|
|
|
|
// keep track of the first CNAME + associated RRs but don't add to the resp.Answer yet
|
|
|
|
// this will only be added if no non-CNAME RRs are found
|
|
|
|
// this will only be added if no non-CNAME RRs are found
|
|
|
|
if len(answerCNAME) == 0 {
|
|
|
|
if len(answerCNAME) == 0 {
|
|
|
|
answerCNAME = records
|
|
|
|
answerCNAME = records
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
resp.Answer = append(resp.Answer, records...)
|
|
|
|
|
|
|
|
had_answer = true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
resp.Answer = append(resp.Answer, records...)
|
|
|
|
|
|
|
|
had_answer = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if had_answer {
|
|
|
|
if had_answer {
|
|
|
|