mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 16:54:15 -04:00
Allow cidr based reverse zone config (#500)
* add cidrs opt * remove state data from middleware object
This commit is contained in:
committed by
John Belamaric
parent
3a04d2a306
commit
8beb1b2166
@@ -26,7 +26,12 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
|
||||
// otherwise delegate to the next in the pipeline.
|
||||
zone := middleware.Zones(k.Zones).Matches(state.Name())
|
||||
if zone == "" {
|
||||
return middleware.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
// If this is a PTR request, and a the request is in a defined
|
||||
// pod/service cidr range, process the request in this middleware,
|
||||
// otherwise pass to next middleware.
|
||||
if state.Type() != "PTR" || !k.IsRequestInReverseRange(state) {
|
||||
return middleware.NextOrFailure(k.Name(), k.Next, ctx, w, r)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user