mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
plugin/file: Fix response for qtype=DS (#1300)
DS is peculiar and needs some special cases to do the right things. For a direct query return the DS, but if we're hitting below the delegation return the NS+DS in a delegation response.
This commit is contained in:
@@ -127,6 +127,15 @@ func (z *Zone) Lookup(state request.Request, qname string) ([]dns.RR, []dns.RR,
|
||||
|
||||
// If we see NS records, it means the name as been delegated, and we should return the delegation.
|
||||
if nsrrs := elem.Types(dns.TypeNS); nsrrs != nil {
|
||||
|
||||
// If the query is specifically for DS and the qname matches the delegated name, we should
|
||||
// return the DS in the answer section and leave the rest empty, i.e. just continue the loop
|
||||
// and continue searching.
|
||||
if qtype == dns.TypeDS && elem.Name() == qname {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
|
||||
glue := z.Glue(nsrrs, do)
|
||||
if do {
|
||||
dss := z.typeFromElem(elem, dns.TypeDS, do)
|
||||
|
||||
Reference in New Issue
Block a user