Skip to content

Instantly share code, notes, and snippets.

@edmonds
Created January 4, 2022 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edmonds/dcbb82872b270eceba88f05ae0281e69 to your computer and use it in GitHub Desktop.
Save edmonds/dcbb82872b270eceba88f05ae0281e69 to your computer and use it in GitHub Desktop.
dnstap monitoring
#
# /etc/unbound/unbound.conf.d/dnstap.conf
#
dnstap:
dnstap-enable: yes
dnstap-socket-path: "/var/log/dnstap/.sock"
dnstap-send-identity: yes
dnstap-send-version: yes
dnstap-log-client-query-messages: yes
dnstap-log-client-response-messages: yes
#
# /etc/cron.daily/dnstap_rotate
#
@monthly root systemctl kill --kill-who=main --signal=SIGUSR1 fstrm_capture 2>&1
#
# /etc/systemd/system/fstrm_capture.service
#
[Unit]
Description=fstrm_capture server
Before=unbound.service
[Service]
Type=simple
User=unbound
Group=unbound
ExecStart=/usr/bin/fstrm_capture --type protobuf:dnstap.Dnstap --unix /var/log/dnstap/.sock --localtime -w /var/log/dnstap/dnstap.%%Y%%m%%d.%%H%%M.%%s
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment