mirror of
https://github.com/coredns/coredns.git
synced 2025-12-08 19:35:10 -05:00
middleware/file: add DNSSEC support (#697)
* middleware/file: add DNSSEC support Add tests for DNSSEC and check if everything is working. * add signatures * tweak * Add DNSSEC signing tests for DNAME * Just sign it all
This commit is contained in:
@@ -105,14 +105,20 @@ func (z *Zone) Lookup(state request.Request, qname string) ([]dns.RR, []dns.RR,
|
||||
|
||||
// If we see DNAME records, we should return those.
|
||||
if dnamerrs := elem.Types(dns.TypeDNAME); dnamerrs != nil {
|
||||
// Only one DNAME is allowed per name. We just pick the first one.
|
||||
// Only one DNAME is allowed per name. We just pick the first one to synthesize from.
|
||||
dname := dnamerrs[0]
|
||||
if cname := synthesizeCNAME(state.Name(), dname.(*dns.DNAME)); cname != nil {
|
||||
answer, ns, extra, rcode := z.searchCNAME(state, elem, []dns.RR{cname})
|
||||
|
||||
if do {
|
||||
sigs := elem.Types(dns.TypeRRSIG)
|
||||
sigs = signatureForSubType(sigs, dns.TypeDNAME)
|
||||
dnamerrs = append(dnamerrs, sigs...)
|
||||
}
|
||||
|
||||
// The relevant DNAME RR should be included in the answer section,
|
||||
// if the DNAME is being employed as a substitution instruction.
|
||||
answer = append([]dns.RR{dname}, answer...)
|
||||
answer = append(dnamerrs, answer...)
|
||||
|
||||
return answer, ns, extra, rcode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user