mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 10:13:14 -05:00
fix(auto/file): return REFUSED when no next plugin is available (#7381)
This commit is contained in:
@@ -51,6 +51,10 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
|
||||
// Now the real zone.
|
||||
zone = plugin.Zones(a.Zones.Names()).Matches(qname)
|
||||
if zone == "" {
|
||||
// If no next plugin is configured, it's more correct to return REFUSED as auto acts as an authoritative server
|
||||
if a.Next == nil {
|
||||
return dns.RcodeRefused, nil
|
||||
}
|
||||
return plugin.NextOrFailure(a.Name(), a.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user