Python Dnstap to JSON stream receiver
Project description
Dnstap to JSON stream receiver
Author | Denis Machard d.machard@gmail.com |
License | MIT |
PyPI | https://pypi.org/project/dnstap_receiver/ |
This Python module acts as a DNS tap receiver and streams as JSON payload to remote address.
Table of contents
Installation
Deploy the dnstap receiver in your DNS server with the pip command.
pip install dnstap_receiver
Start dnstap receiver
dnstap_receiver -u /var/run/dnstap.sock -j 10.0.0.2:8000
dnstap_receiver --help
usage: test_receiver.py [-h] -u U -j J
optional arguments:
-h, --help show this help message and exit
-u U read dnstap payloads from unix socket
-j J write JSON payload to tcp/ip address
Systemd service
System service file for Centos7
vim /etc/systemd/system/dnstap_receiver.service
[Unit]
Description=Python DNS tap Service
After=network.target
[Service]
ExecStart=/usr/local/bin/dnstap_receiver -u /etc/dnsdist/dnstap.sock -j 10.0.0.2:6000
Restart=on-abort
Type=simple
User=root
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start dnstap_receiver
systemctl status dnstap_receiver
systemctl enable dnstap_receiver
Tests with DNS servers
PowerDNS's configuration
vim /etc/dnsdist/dnsdist.conf
fsul = newFrameStreamUnixLogger("/var/run/dnstap.sock")
addResponseAction(AllRule(), DnstapLogResponseAction("dns", fsul))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dnstap_receiver-0.0.1.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for dnstap_receiver-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41421c2fd4896dd2c605f11dfd027da2d1f32ec57fe46ee2e9bcc2273d99960d |
|
MD5 | 2d5d85ec53fa558a5e6d1f96864a0819 |
|
BLAKE2b-256 | a7ec866b989539467922a50a8e0ea3fb8d1653deedbbeb6cd05883554f6464bd |