massdns(1)
πΈ NAME πΈ
okay so welcome to massdns(1) bestie π β this is the manual for massdns, the high-performance DNS stub resolver for bulk lookups and reconnaissance. It is literally built for researchers doing internet measurements and for bug bounty hunters leveraging it for subdomain enumeration during their reconnaissance process. slay β¨
π¦ SYNOPSIS π¦
massdns [options] -r resolvers.txt domains.txt
π DESCRIPTION π
So massdns is a high-performance DNS stub resolver. It is targeting researchers performing internet measurements and bug bounty hunters leveraging it for subdomain enumeration during their reconnaissance process. Because it is a stub resolver, massdns relies on third-party resolvers to perform recursive lookups. No cap.
massdns is written in C and does not make use of threads. Instead, it uses epoll on Linux to handle communication concurrently. The number of concurrent lookups is user-controlled. All DNS requests are made using UDP. periodt. π
π COMMAND-LINE OPTIONS π
massdns currently does not follow POSIX convention recommendations. All command line arguments and their values have to be separated by spaces. iykyk β¨
-b,--bindtoβ IP addresses formassdnsquery sockets. When this option is not specified,massdnswill bind to0.0.0.0:0, causing the operating system to pick an appropriate IP address and port. If this option is specified multiple times, a query socket for each address is created. When sending a query, a socket is then selected at random. π--busy-pollβ Instead of usingepoll,massdnswill make use of busy-waiting. This is a non-configurable default on non-Linux platforms, whereepollis not available. This is not very efficient, so you should refrain from using this option in most cases. fr fr, be careful with this one. π-c,--resolve-countβ This value is an integer that specifies how oftenmassdnsattempts to resolve a name. A failure reason can either be due to a timeout (as specified by-i) or an unacceptable response code (as specified by--retry). For reliable resolvers and when an appropriate concurrency value is set, this value can be quite low. The default value is50, which is very high. π--drop-userβ This option is only relevant when you run the program as root, which is not recommended for security reasons. In this case, privileges will be dropped to the specified user. If this option is not specified, this will be thenobodyuser if it exists on the system. If--drop-groupis not specified, the group will be set to the main group of the specified user, which isnogroupfornobody. security bestie behavior. π«Ά--drop-groupβ When being run as root, set the group to this value instead of the main group of the user specified by--drop-user. π--extended-inputβ By default,massdnstreats each input line as a query. When this option is specified, a line will be treated as a query separated from resolver addresses by a space. Instead ofexample.com, an input line can then beexample.com 1.1.1.1 8.8.8.8:53, causing the program to attempt to resolveexample.comvia1.1.1.1and8.8.8.8before falling back to the resolver list. Port specification is optional. By default, DNS port53is used. this one is lowkey iconic for recon. π¦--filterβ This option defines a DNS response code whitelist of packets to be printed. It can be specified multiple times. For example,--filter NXDOMAIN --filter REFUSEDwill only print packets with the specified codes. DNS response codes can either be specified textually or numerically. This option and--ignoreare mutually exclusive. π--flushβ This option causes the output stream to be flushed whenever a response was written. β¨--helpβ Shows a help text that is more compressed than this man page. ngl, this page is the full vibe. π--ignoreβ In contrast to--filter, this option defines a blacklist. π-i,--intervalβ This option specifies a timeout in milliseconds to wait between multiple resolves of the same domain. The default value is500. β³-l,--error-logβ Instead of logging to/dev/stderr, log to the specified file. This is useful because the status output can be quite noisy and cause errors to be overlooked when printed to stderr as well. save your eyes, bestie. π--norecurseβ DNS has a flag calledRD, which is short for βRecursion Desiredβ. By default,massdnsassumes that you want to use it with recursive resolvers, so it will set this bit. Sometimes, for example when performing DNS cache snooping, you may want to unset this bit. You may also want to unset this bit when performing subdomain enumeration against authoritative nameservers. π-o,--outputβ This option specifies the output format. The first character specifies the general output class, such as whether to output JSON, human-readable full-text or binary data. The following characters specify advanced output flags that are specific to this output class.
The following output classes are supported:
Lβ list output β Only output the query names of response packets, i.e. effectively only output domains. π
Advanced output flags:
0β By default, the list output mode will only output query names of packets that have at least one answer record. When this flag is enabled, the list output will also outputNOERRORpackets without answers. This is particularly useful for performing subdomain enumeration against some nameservers, where aNOERRORcode might give away that another record type than the queried one exists for the DNS name. big subdomain-enum energy. π₯
Sβ simple text output β Due to the multitude of advanced flags that have accumulated over time, the βsimple text outputβ has become less simple. It now supports many flags that allow for an advanced customization of the output. Really, you should probably use JSON instead. By default, this output mode outputs all resource records of the DNS answer section that match the question name. Each record will be on a separate line. If any advanced output flag has been specified, this output mode will also print resource records that do not match the question name, unless specified otherwise by the advanced output flagm.
Advanced output flags:
dβ Include records from the additional section. As the simple text output outputs records from the answer section by default, enabling this flag will only output records from the additional section, unless the output of records from other sections is explicitly turned on. π§iβ Indent resource records with a tab. This is especially useful when the DNS question is printed. β¨mβ Only output resource records that match the question name. π―nβ Include records from the answer section. This option works analogously to thedoption. π«qβ Instead of only outputting resource records, also output the DNS question. βrβ Print the question with resolver IP address, Unix timestamp and response code prepended. This flag implies theqflag. π°οΈsβ Print an additional newline character after each DNS packet. πΈtβ Include TTL and record class within the output. πuβ Include records from the authority section. This option works analogously to thedoption. π
Fβ full text output β This output mode is not customizable and outputs all successful responses in the style of thedigtool. πFβ binary output β The uncustomizable binary format has no binding specification but follows from the source code. The repository includes adnsparse.pyscript that is kept up to date with the binary format as output bymassdns. πΎJβ NDJSON (new-line delimited JSON) β This output causes each response packet to be printed as a JSON object. π§Ύ
Advanced output flags:
eβ Instead of only writing JSON objects for successful resolves, also write a record for each terminal failure, such as a final timeout or a final unacceptable response code. terminal failure but make it JSON. π
Note that not all record types are supported. Only the binary output mode allows you to preserve the content of all records as it writes raw DNS packets to the output stream. The following record types are currently supported in non-binary output modes: A, AAAA, CAA, CNAME, DNAME, MX, NS, SRV, PTR, SOA, TXT. write that down bestie. π
--predictableβ By default, the resolver for a query will be picked randomly for each transmission. If this option is specified, the resolver will be picked in a deterministic, predictable manner. The first query will use the first resolver from the list, the second query will use the second one and so on (modulo the number of resolvers). This can be leveraged to conduct resolver tests. π§ͺ--processesβ In case resolving with a single process is not fast enough, you can use more than one process. This option specifies the number of processes to be used, so the default value is1. When multiple processes are used,-wneeds to be specified.massdnswill then fork and write the output of each process to a different file, following a shared-nothing approach. more processes, more chaos, more slay. π₯--quietβ When this option is specified,massdnswill not print progress stats and it will not display some warnings. π€«--rand-src-ipv6β When this option is supplied with an IPv6 subnet in CIDR notation,massdnswill use a raw UDP socket for IPv6 resolvers. For each query, a random IP address from the subnet is used. This allows to bypass rate limits for some public IPv6 resolvers. It will only work if your machine is provided with a routed prefix and can use addresses from within its subnet without neighbor discovery. IPv6 girlies rise. π--rcvbufβ Size of the receive buffer of the query socket(s) in bytes. π¦-r,--resolversβ File containing the list of resolvers/nameservers to be used. Each line should contain an IPv4 or IPv6 address. Specifying ports (using a colon, together with square brackets in case of IPv6 addresses) is optional. By default, DNS port53will be used. π«Ά--retryβ okay so this is the βwhat counts as a fail and gets another shotβ knob. You give it the DNS response codes that are considered a failure and cause a lookup to be retried. By default, massdns retries lookups for all responses withoutNOERRORorNXDOMAINresponse code. The second you specify this option, it behaves as a whitelist for retries. Why is that useful? Because some resolvers will return codes such asREFUSEDorSERVFAILonce you hit internal rate limits, and when youβre doing subdomain enumeration you do not want to miss responses in this case, so they are retried automatically. This option accepts DNS response codes in textual or numeric format. It also supports the special valuenever, which instructs massdns to never consider any valid DNS response to be unacceptable. That would be a reasonable setting when working with reliable, trusted resolvers. π--rootβ do not drop the privileges when running as root. For security reasons, using this option is not recommended. π«£-s,--hashmap-sizeβ this option accepts an integer that controls the number of concurrent lookups and thus the lookup rate. Too low? Then the available network performance is not exhausted. Too high? It may overload resolvers or cause network congestion. Internally, massdns makes use of a hash map which stores information about ongoing lookups, so this option defines the number of ongoing lookups. When all slots of the hash map are occupied, the next lookup will take place as soon as one lookup times out (as specified by--i) or returns an unacceptable response (as specified by--retry). The value of this option is directly correlated with the number of successful lookups per second. Consider a single, non-rate-limiting name server with an average RTT of ca.10ms. A value of1for this option can then already reach about100successful lookups per second. The default value of this option is10,000. This option supports the special valueauto, which aims to adjust the concurrency automatically. At the moment, theautofeature doubles the number of concurrent lookups until timeouts are observed. Thus, this feature is experimental and useful only when all resolvers are100 %reliable, e.g. in case they are authoritative. β‘--sndbufβ size of the send buffer of the query socket(s) in bytes. π--status-fmtβ this option can be eitherjsonoransi. When it is not specified, it defaults toansi, causing massdns to print out stats in human-readable format tostderr. In case you want to automate the use of massdns, you may want to usejsonto parse the output. β¨--stickyβ without this option, each lookup (including its retries) will pick a resolver at random. With this option, retries will stick to the same resolver. π§--socket-countβ if--bindtohas not been specified, this option controls the number of query sockets to use per IP version. πΈ-t,--typeβ the DNS record type to be queried for. When this option is not present, the default value isA. This option can be specified multiple times to query for multiple record types. Record types you may want to query include, but are not limited to,A,AAAA,MX,NS,TXT. π--verify-ipβ by default, massdns will not verify incoming IP addresses. This option enables source IP verification of incoming packets. π₯-w,--outfileβ instead of writing results tostdout, write them to the file specified by this option. π
π WEBSITE π
https://github.com/blechschmidt/massdns
Thatβs a wrap, bestie β this page is for massdns 1.0.0, dated 2021, and the manual page is massdns(1). Mwah πβ¨
π¦ where this page comes from
- nixos 26.05: massdns 1.1.0
- nixpkgs unstable: massdns 1.1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms