massdns Rate Limit Flags: -q, --max-qps, --max-queries
What --max-qps, -q, --max-queries actually do in massdns — the queries-per-second flag, in-flight slot limit, and how to pick values that don't melt your resolver.
massdns is a high-performance DNS stub resolver that can reach 350,000+ queries per second. Two flags control rate, and they are easy to confuse.
TL;DR
| Flag | Long form | Default | What it limits |
|---|---|---|---|
-q | none | unlimited | Quiet mode (no progress output). Not queries-per-second. |
--max-qps N | --max-qps N | 0 (no limit) | Maximum queries per second sent across all resolvers. |
-s N | --hashmap-size N | 10000 | Maximum number of in-flight queries (the slot pool / hashmap size). |
-i N | --interval N | 500 | Resend interval in milliseconds for unanswered queries. |
-r FILE | --resolvers FILE | required | Path to resolver list. Throughput scales with resolver count, not just --max-qps. |
There is no --qps, --max-queries, or --maximum-queries-per-second flag. The single rate knob is --max-qps.
Common confusions
-q is not “queries per second”. It’s the quiet flag — suppresses the per-second progress bar. Easy mistake because the long-form for the rate limit is --max-qps, which you might shorthand in your head as -q.
Maximum queries per second != maximum in-flight queries. --max-qps 1000 sends 1000 new queries per wall-clock second. -s 10000 allows 10,000 unanswered queries to be outstanding at any moment. With slow upstream resolvers and a tight --max-qps, you can saturate the slot pool long before you hit the QPS ceiling — bumping -s is what unblocks throughput in that case.
Resolver count caps real-world QPS. Each resolver in your list gets queries round-robin. If --max-qps is 4000 but you only have 20 healthy resolvers in -r resolvers.txt, every resolver eats 200 qps — most public resolvers will rate-limit you well below that. Either lower --max-qps or use a longer resolver list (the Public DNS Server List is a common starting point, though most entries are unstable).
Sane starting values
massdns \ -r resolvers.txt \ -t A \ -o S \ --max-qps 1000 \ -s 10000 \ -i 500 \ domains.txt > results.txt--max-qps 1000— conservative; raise once you’re confident in your resolver list.-s 10000(default) — fine for most workloads; raise to 50000+ for slow resolvers / WAN-heavy lookups.-i 500— 500 ms retry interval; lower if you’re using fast local resolvers, raise (1000–2000) if you’re hammering public infrastructure.
When to step beyond --max-qps
--max-qps is a fixed ceiling. If you want adaptive rate control that backs off on errors and probes upward on success, that’s the AIMD rate limiting pattern — TCP congestion control applied to a DNS scanner. Useful when you don’t know the ceiling in advance.
For the architectural side — why Go can match massdns’s per-thread efficiency by going single-process-multi-goroutine — see Building a High-Throughput DNS Scanner in Go.
Sources
man massdns— official flag reference (B. Blechschmidt)zdns— Go-based alternative from ZMap; flags are different but solves the same problem- DNS Resolution: The Full Picture — what’s actually happening behind each query