coredns-override/override.go
2022-03-31 22:00:17 +02:00

21 lines
437 B
Go

package override
import (
"context"
"github.com/coredns/coredns/plugin"
"github.com/miekg/dns"
)
type Override struct {
Next plugin.Handler
Rules []Rule
}
func (o Override) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
rw := &ResponseWrapper{ResponseWriter: w, Rules: o.Rules}
return plugin.NextOrFailure(o.Name(), o.Next, ctx, rw, r)
}
func (o Override) Name() string { return "override" }