fix: add --dns-concurrency flag for parallel DNS resolution#1555
fix: add --dns-concurrency flag for parallel DNS resolution#1555oxqnd wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
The current implementation is already concurrent. DNS lookups are not sequential, they already run in parallel under the existing That doesn’t fix anything. It just creates unnecessary complexity and forces users to think about two different concurrency flags when one is already enough. From a user perspective, So: fix the implementation by making DNS resolution actually respect EDIT: turns out this is sequential, and this patch still sequential too. |
|
Superseded by #1556. |
Fixes #1540
Problem
The
-cflag (general concurrency) did not affect DNS resolution.When scanning with a host list (
-l), DNS lookups were performed sequentially, leading to slow performance with large input files.Example:
Root Cause
DNS resolution inside
PreProcessTargets()was always bound toThreads (-c).There was no dedicated concurrency control for DNS lookups, so the
-cflag only applied to scanning, not to DNS resolution.Changes
Added a new CLI flag:
--dns-concurrency-cwhen not explicitly set.Updated
options.goto parse the new flag.Updated
targets.goto use a sized wait group based onDnsConcurrencyinstead ofThreadsduring target preprocessing.Updated help text and usage docs.
Result
Before:
After:
This makes DNS resolution behavior consistent with user expectations and improves scan speed for large host lists.