capture DNS QUERY traffic ,written in golang, support mirror port(可镜像口抓取).
This program use gopacket to capture DNS REQUEST,and use beego ORM MYSQL to log into mysql database.
golang
gopacket
beego
go-sql-driver
libpcap-dev
Test on Debian
go run dns_log.go
OR compile it to binary,and execute it.
You should edit database configurations to adapt to yours.
1. create a database
2. the program will auto create table and log dns queries