add recursive cname stub to resolver answer set
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Elizabeth Hunt 2024-03-31 14:34:37 -06:00
parent 2c6b124664
commit ad30583265
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 52B3774857EB24B1
1 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,12 @@ func resolveRecursive(dbConn *sql.DB, dnsResolvers []string, domain string, qtyp
answers := []dns.RR{} answers := []dns.RR{}
for _, record := range internalCnames { for _, record := range internalCnames {
cname, err := dns.NewRR(fmt.Sprintf("%s %d IN CNAME %s", record.Name, record.TTL, record.Content))
if err != nil {
return nil, err
}
answers = append(answers, cname)
cnameRecursive, _ := resolveRecursive(dbConn, dnsResolvers, record.Content, qtype, maxDepth-1) cnameRecursive, _ := resolveRecursive(dbConn, dnsResolvers, record.Content, qtype, maxDepth-1)
answers = append(answers, cnameRecursive...) answers = append(answers, cnameRecursive...)
} }