blechschmidt / massdns

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

Empty data.answers[] when doing too many requests #138

Closed xhzeem closed 1 year ago

xhzeem commented 1 year ago

I got an issue while using the tool where sometimes I got empty data object (output as JSON), and the answers are not presented with the output, I ran a scan on 8k domains, 2k out of them did return with no answers so it's like the following:

{"name":"xhzeem.me","type":"A","class":"IN","status":"NOERROR","rx_ts":1675241915120534279,"data":{},"flags":["tc","rd","ra"],"resolver":"1.1.1.1:53","proto":"UDP"}

This was my command and I got 2k that have data={}

cat domains.txt | massdns -r res.txt -q --retry NXDOMAIN --filter NOERROR -o J | jq -s | jq -r '.[] | select(.data=={}) | .name' | wc -l
blechschmidt commented 1 year ago

It looks like you are hitting a rate limit which requires retrying via TCP (as indicated by the tc flag). de6a07482d6186eed3344693f4e575ff4a57885d enables TCP by default. The default implementation uses one TCP socket per query, so depending on your concurrency, this might affect your performance quite significantly.

Please see https://github.com/blechschmidt/massdns/issues/66#issuecomment-1343161691 for --tcp-raw support with maximum performance.