diff options
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r-- | plugin/forward/setup.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go index 125d53e4c..7504e9409 100644 --- a/plugin/forward/setup.go +++ b/plugin/forward/setup.go @@ -10,6 +10,7 @@ import ( "github.com/coredns/caddy" "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" + "github.com/coredns/coredns/plugin/dnstap" "github.com/coredns/coredns/plugin/pkg/parse" pkgtls "github.com/coredns/coredns/plugin/pkg/tls" "github.com/coredns/coredns/plugin/pkg/transport" @@ -34,6 +35,14 @@ func setup(c *caddy.Controller) error { c.OnStartup(func() error { return f.OnStartup() }) + c.OnStartup(func() error { + if taph := dnsserver.GetConfig(c).Handler("dnstap"); taph != nil { + if tapPlugin, ok := taph.(dnstap.Dnstap); ok { + f.tapPlugin = &tapPlugin + } + } + return nil + }) c.OnShutdown(func() error { return f.OnShutdown() |