Skip to content

Instantly share code, notes, and snippets.

@urjitbhatia
Last active May 19, 2021 18:52
Show Gist options
  • Save urjitbhatia/e8110994ec1ed01dc3509301255aef7b to your computer and use it in GitHub Desktop.
Save urjitbhatia/e8110994ec1ed01dc3509301255aef7b to your computer and use it in GitHub Desktop.
easy way to continuously log dns queries
#!/bin/bash
# replace any with a specific interface you want to monitor or just use any to capture all interfaces
tcpdump -i any 'dst port 53' >> /var/log/dnsqueries.log
#### If using supervisord, use this template for setting up the program entry:
# [program:dnsworker]
# command=bash dnsquerylogger.sh
# autostart=true
# autorestart=true
# startsecs=1
# startretries=3
# user=root
# redirect_stderr=true
# stdout_logfile=/var/log/dnsquerylogger.proc.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment