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
Copy file name to clipboardExpand all lines: README.md
+82-30
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,33 @@
2
2
3
3
### bulkDNS: A fast DNS scanner for large-scale Internet measurement
4
4
5
-
Using **bulkDNS**, you can scan millions of domain names in a few minutes. The scanner has been designed to be fast with a very small footprint.
5
+
Using **bulkDNS**, you can scan millions of domain names in a few minutes. The scanner has been designed to be fast with a very small footprint. It also supports customized scan scenarios through Lua scripting.
6
6
7
7
The output of bulkDNS is a detailed JSON structure (example at the end of the page) which can be parsed both by command-line (e.g., by `jq`) or any programming language.
8
8
9
9
### Menu
10
10
11
11
*[How to compile bulkDNS](#How-to-compile)
12
+
*[Compile without Lua](#Compile-without-Lua)
13
+
*[Compile with Lua for customized scan scenarios](#Compile-with-Lua-for-customized-scan-scenarios)
12
14
*[Supported Resource Records (RRs)](#Supported-Resource-Records)
13
15
*[List of Switches](#List-of-Switches)
14
16
*[Example Output](#Example-Output)
15
17
*[Notes](#Notes)
16
-
* [A note on threads](#A-note-on-threads)
18
+
* [A note on threads and concurrency](#A-note-on-threads-and-concurrency)
17
19
* [A note on names and conventions](#Names-and-output-convention)
18
20
* [Hex representation of the output](#Hex-represantaion-of-the-output)
19
21
*[FAQ](#FAQ)
20
22
21
23
22
24
### How to compile
23
25
26
+
You have two options to compile bulkDNS. If You just want to use the scanner for scanning resource records like `A`, `AAAA`, `NS`, `MX`, etc, You can compile the scanner without Lua which is very easy. However, if you want to use `--server-mode` option or you have your own scan scenarios in mind that is more complicated than a simple resource record, then you must compile _bulkDNS_ with Lua support. Here is the instruction for both cases:
27
+
28
+
#### Compile without Lua
29
+
30
+
This is the first case (just scanning resource records)
31
+
24
32
You need to have `jansson` and `pthread` installed.
25
33
26
34
```bash
@@ -42,12 +50,49 @@ make
42
50
43
51
The compiled output is inside the `bin` directory.
44
52
53
+
#### Compile with Lua for customized scan scenarios
54
+
55
+
In this case, you need to have `lua5.4`, `pthread` and `jansson` installed. Here is the procedure:
It also supports adding **EDNS0** (**DNSSEC-OK** and **NSID**) to queries.
53
98
@@ -70,27 +115,31 @@ All the RRs and EDNS0 are implemented based on the following RFCs (Some implemen
70
115
[Help]
71
116
72
117
Summary:
73
-
BulkDNS scanner based on sdns low-level DNS library.
74
-
75
-
./bulkdns [OPTIONS] <INPUT|FILE>
76
-
--udp-only Only query using UDP connection (Default will follow TCP)
77
-
--set-do Set DNSSEC OK (DO) bit in queries (default is no DO)
78
-
--noedns Do not support EDNS0 in queries (Default supports EDNS0)
79
-
--set-nsid The packet has NSID in edns0
80
-
--threads=<param> How many threads should be used (it's pthreads, and default is 300)
81
-
-t <param>, --type=<param> Resource Record type (A, AAAA, NS, etc). Default is 'A'
82
-
-c <param>, --class=<param> RR Class (IN, CH). Default is 'IN'
83
-
-r <param>, --resolver=<param> Resolver IP address to send the query to (default 1.1.1.1)
84
-
-p <param>, --port=<param> Resolver port number to send the query to (default 53)
85
-
-o <param>, --output=<param> Output file name (default is the terminal with stdout)
86
-
-e <param>, --error=<param> where to write the error (default is terminal with stderr)
87
-
-h , --help Print this help message
118
+
Bulk DNS scanner based on sdns low-level DNS library.
88
119
89
-
We currently supports the following RR:
90
-
A, AAAA, NS, RRSIG, SOA, MX, SRV, URI, PTR,
91
-
HINFO, TXT, CNAME, NID, L32, L64, LP, CAA
92
-
Supported DNS classes: IN, CH
120
+
./bulkdns [OPTIONS] <INPUT|FILE>
93
121
122
+
-t <param>, --type=<param> Resource Record type (Default is 'A')
123
+
-c <param>, --class=<param> RR Class (IN, CH). Default is 'IN'
124
+
-r <param>, --resolver=<param> Resolver IP address to send the query to (default 1.1.1.1)
125
+
-p <param>, --port=<param> Resolver port number to send the query to (default 53)
126
+
-e <param>, --error=<param> where to write the error (default is terminal with stderr)
127
+
-o <param>, --output=<param> Output file name (default is the terminal with stdout)
128
+
--lua-script=<param> Lua script to be used either for scan or server mode
129
+
--bind-ip=<param> IP address to bind (default 127.0.0.1 for scan mode, 0.0.0.0 for server-mode)
130
+
--timeout=<param> Timeout of the socket (default is 5 seconds)
131
+
--concurrency=<param> How many concurrent requests should we send (default is 1000)
132
+
--udp-only Only query using UDP connection (Default will follow TCP)
133
+
--set-do Set DNSSEC OK (DO) bit in queries (default is no DO)
134
+
--set-nsid The packet has NSID in edns0
135
+
--noedns Do not support EDNS0 in queries (Default supports EDNS0)
136
+
--server-mode Run bulkDNS in server mode
137
+
-h, --help Print this help message
138
+
139
+
bulkDNS currently supports the following RRs:
140
+
A, AAAA, NS, RRSIG, SOA, MX, SRV, URI, PTR,
141
+
HINFO, TXT, CNAME, NID, L32, L64, LP, CAA
142
+
Supported DNS classes: IN, CH
94
143
```
95
144
96
145
### Example Output
@@ -148,20 +197,21 @@ We try to keep the output as close as possible to DNS RFC standards.
148
197
149
198
### Notes
150
199
151
-
#### A note on threads
200
+
#### A note on threads and concurrency
152
201
153
202
* bulkDNS is capable of scanning 1,000,000 (1M) domain names in around 5 minutes with less than 1% of errors using default number of threads (300). That means you can
154
203
scan the whole domain name system in less than one day.
155
204
This makes it probably the most practical (and maybe fastest) DNS scanner. It does not have any requirements in terms of CPU or RAM. As all other network scanners,
156
205
the bottleneck is always the network bandwidth, firewalls and the remote recursive resolver. We recommend using Cloudflare quad one (1.1.1.1) as the resolver since
157
206
it has no limit in terms of the number of queries. However, you can also run your own recursive resolver to do the job. If you decrease the number of threads, you can
158
-
also use google quad eight (8.8.8.8) which has 1,500 queries/second limit.
207
+
also use google quad-eight (8.8.8.8) which has 1,500 queries/second limit.
208
+
209
+
* Using `--concurrency` option, you can increase or decrease the number of concurrent requests based on your network and your experience. It's important to note that if you set `--concurrency=1000`, it means you ask for openning 1,000
210
+
sockets (which means binding to 1,000 ports) at the same time.
159
211
160
-
*Using `--threads` option, you can increase or decrease the number of threads based on your network and your experience. However, at some point, more threads will probably
161
-
make the scanner even slower (threads competing each other to acquire the lock).
212
+
*If you are running the scanner on Linux, the maximum number of open files is 1024 by default. So if you plan to set
213
+
the `--concurrency` to a value greater than 1000, then you need to increse the limit of open files using `ulimit -n` commands.
162
214
163
-
* If you are running the scanner on Linux, the maximum number of open files is 1024 by default which is three times more than the default number of threads in bulkDNS.
164
-
However, if you plan to run bulkDNS with more threads, you may want to increase the number of open files using the `ulimit -n` commands.
165
215
166
216
167
217
#### Names and output convention
@@ -211,10 +261,12 @@ In the above example the `cpu` is the hex represantation of `some-kinda-cpu` and
211
261
212
262
### FAQ
213
263
1. Why another scanner?
214
-
- Because I feel like it
264
+
- Because It's fun!
215
265
1. Why not using CMake in the project?
216
266
- I don't know CMake
217
267
2. Is there any similar project like this?
218
268
- The only comparable project to this one (that I'm aware of) is zmap/zdns.
219
269
3. Can I pass a domain name (e.g., `ns1.google.com` as the resolver)?
220
270
- No. The resolver must be an IPv4 address. We pass this value to `inet_addr()` function which accepts an IPv4.
271
+
4. How fast it can scan domain names?
272
+
- It highly depends on your network and the (remote) resolver you use.
0 commit comments