You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-rate and -max-queries count names, not DNS queries, so wire traffic can be 2-9x the configured limit #32
-rate is documented as "Max DNS queries per second across all workers", and -max-queries as "Max DNS lookups to admit". Both actually count jobs (candidate names), not DNS queries. One job sends one query per record type, per attempt. With the default -type A,AAAA, -rate 50 puts up to about 100 qps on the wire. With -type A,AAAA,CNAME -attempts 3 it is up to 450 qps, plus per-parent wildcard probes in recursive mode, which are not rate-limited at all.
Users set -rate to stay under a resolver's or a client's rate limit, often as an explicit term of an authorized engagement. Under-counting by 2-9x is the kind of error that gets a scanner IP banned or breaks rules of engagement.
Separately (ROADMAP N1), the time.Ticker gate drops ticks while workers are busy, so throughput can also fall below the requested rate.
Evidence
main.go:107,112: flag help text.
internal/scan/runner.go:281-290 and :440-446: one limiter receive per job in processJob.
internal/dns/resolver.go:113-144: one network lookup per type. resolver.go:170-195: retry loop.
internal/scan/runner.go:487 and internal/dns/resolver.go:214-215: wildcard probes bypass the limiter.
README "CLI flags" table repeats both descriptions.
Suggested approach
Move pacing to the per-query level. Pass a limiter (a token bucket such as golang.org/x/time/rate, or a small in-house bucket to stay dependency-free) into ResolveTypes / CheckWildcard, so every wire query takes a token. A token bucket also fixes the N1 under-delivery.
For -max-queries, either count wire queries too, or rename the help text to "Max candidate names to test" and document the multiplier.
Add a test with a counting resolveHook or testdns that asserts observed qps <= rate x (1 + tolerance).
Done when
-rate N bounds actual DNS packets per second, retries and wildcard probes included, within a small tolerance, and a test proves it.
The flag help text, README and docs/index.md describe exactly what is counted.
Activity