forked from dmachard/dnsdist-config-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogging_protobuf.lua
More file actions
23 lines (15 loc) · 773 Bytes
/
logging_protobuf.lua
File metadata and controls
23 lines (15 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- dnstap logging for dns traffic, can be used with the remote logger like https://github.com/dmachard/go-dnscollector
-- listen on localhost
setLocal("0.0.0.0:53", {})
-- backend dns
newServer({address = "1.1.1.1:53", pool="default"})
-- init remote logger
protobuf_logging = newRemoteLogger("192.168.1.20:6000")
-- log all queries
addAction(AllRule(), RemoteLogAction(protobuf_logging, nil, {serverID="dnsdist_server"}))
-- log all replies
addResponseAction(AllRule(), RemoteLogResponseAction(protobuf_logging, nil, true, {serverID="dnsdist_server"}))
-- log all replies from cache
addCacheHitResponseAction(AllRule(), RemoteLogResponseAction(protobuf_logging, nil, true, {serverID="dnsdist_server"}))
-- default rule
addAction( AllRule(), PoolAction("default"))