blechschmidt / massdns

A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)
GNU General Public License v3.0
3.08k stars 460 forks source link

Multiple source ports #15

Closed chanduusc closed 7 years ago

chanduusc commented 7 years ago

Is it possible to have multiple ports rather than re-using same port...if one dns request is detected by threat as a firewall, all consequent queries match same session and gets discarded

blechschmidt commented 7 years ago

Due to massdns using a single socket, it is not currently possible to randomize the source ports without the use of additional tools. Using the packetrand tool from the freebind project, which now supports source port randomization, you should be able to achieve what you want though. You would bind MassDNS to a fixed port in this case and instruct iptables to pass all packets to and from the DNS resolvers to the netfilter queue which packetrand is attached to and specify the MassDNS port using packetrand's -r argument.