aboutsummaryrefslogtreecommitdiff
path: root/plugin/file/lookup.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/file/lookup.go')
-rw-r--r--plugin/file/lookup.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugin/file/lookup.go b/plugin/file/lookup.go
index 3142e97f6..4d4b19cd6 100644
--- a/plugin/file/lookup.go
+++ b/plugin/file/lookup.go
@@ -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)