aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/dnstap.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/forward/dnstap.go')
-rw-r--r--plugin/forward/dnstap.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugin/forward/dnstap.go b/plugin/forward/dnstap.go
index e005cc02a..4e06ac1ff 100644
--- a/plugin/forward/dnstap.go
+++ b/plugin/forward/dnstap.go
@@ -34,7 +34,10 @@ func toDnstap(f *Forward, host string, state request.Request, opts options, repl
ta = &net.TCPAddr{IP: ip, Port: int(port)}
}
- msg.SetQueryAddress(q, ta)
+ // Forwarder dnstap messages are from the perspective of the downstream server
+ // (upstream is the forward server)
+ msg.SetQueryAddress(q, state.W.RemoteAddr())
+ msg.SetResponseAddress(q, ta)
if f.tapPlugin.IncludeRawMessage {
buf, _ := state.Req.Pack()
@@ -51,7 +54,8 @@ func toDnstap(f *Forward, host string, state request.Request, opts options, repl
r.ResponseMessage = buf
}
msg.SetQueryTime(r, start)
- msg.SetQueryAddress(r, ta)
+ msg.SetQueryAddress(r, state.W.RemoteAddr())
+ msg.SetResponseAddress(r, ta)
msg.SetResponseTime(r, time.Now())
msg.SetType(r, tap.Message_FORWARDER_RESPONSE)
f.tapPlugin.TapMessage(r)