mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
[plugin/route53]: Do not return NXDOMAIN where it should be NODATA. (#2734)
* [plugin/route53]: Do not return NXDOMAIN where it should be NODATA. Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com> * Fix bad merge. Signed-off-by: Dmitry Ilyevskiy <dmitry.ilyevskiy@getcruise.com>
This commit is contained in:
@@ -119,12 +119,15 @@ func (h *Route53) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
h.zMu.RLock()
|
||||
m.Answer, m.Ns, m.Extra, result = hostedZone.z.Lookup(ctx, state, qname)
|
||||
h.zMu.RUnlock()
|
||||
if len(m.Answer) != 0 {
|
||||
|
||||
// Take the answer if it's non-empty OR if there is another
|
||||
// record type exists for this name (NODATA).
|
||||
if len(m.Answer) != 0 || result == file.NoData {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if len(m.Answer) == 0 && h.Fall.Through(qname) {
|
||||
if len(m.Answer) == 0 && result != file.NoData && h.Fall.Through(qname) {
|
||||
return plugin.NextOrFailure(h.Name(), h.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user