gamelinux / passivedns

A network sniffer that logs all DNS server replies for use in a passive DNS setup
http://gamelinux.org/
1.67k stars 374 forks source link

Multi threading/ Multi worker setup #114

Open mosajjal opened 5 years ago

mosajjal commented 5 years ago

Hi,

I'm using passivedns on a big chunk of traffic but it only uses one core and one process. Is there any way we can add threading or worker functionality to passivedns? I believe the choke point would be the log file being written on from all the different processes. Any ideas?

Cheers,

gamelinux commented 3 years ago

Hi, I used to use pf_ring and zbalance to do this. But two year ago I was looking into how to write some code to do the same with af_packet, but ended up writing passivedns in golang instead.... using af_packet and fanout.... I use this in production here... My hope is to clean up the code and push to github one day! The golang version is more aimed at my use (core pdns functionality), but with user inputs, it might evolve to something others want to use to.

mosajjal commented 3 years ago

I did end up writing a piece of code to do this using golang as well (mostly borrowed from gopassivedns), gitlab.com/mosajjal/dnsmonster. any PR and/or contrib is welcome :) we can join forces to build something scalable if the end goals match

gamelinux commented 3 years ago

Nice! Read your blog! When I get time, Ill look over your golang code. My golang version of passivedns outputs json to a logfile. But yeah, other output plugins should be trivial to add I guess. Ill ping you when I get up to speed.