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