Skip to main content
For all of the flags and options available for dnsx be sure to check out the Usage page. On this page we share examples running ‘dnsx’ with specific flags and goals and the output you can expect from each.
If you have questions, reach out to us through Help.

Basic Examples

DNS Resolving

Filter active hostnames from the list of passive subdomains, obtained from various sources:
Print A records for the given list of subdomains:
Extract A records for the given list of subdomains:
Extract CNAME records for the given list of subdomains:
Extract ASN records for the given list of subdomains:
Probe using dns status code on given list of (sub)domains:
Extract subdomains from given network range using PTR query:
Extract subdomains from given ASN using PTR query:

DNS Bruteforce

Bruteforce subdomains for given domain or list of domains using d and w flag:
Bruteforce targeted subdomain using single or multiple keyword input, as d or w flag supports file or comma separated keyword inputs:
Values are accepted from stdin for all the input types (-list, -domain, -wordlist). The -list flag defaults to stdin, but the same can be achieved for other input types by adding a - (dash) as parameter:

DNS Bruteforce with Placeholder based wordlist

Wildcard filtering

A special feature of dnsx is its ability to handle multi-level DNS based wildcards, and do it so with a very reduced number of DNS requests. Sometimes all the subdomains will resolve, which leads to lots of garbage in the output. The way dnsx handles this is by keeping track of how many subdomains point to an IP and if the count of the subdomains increase beyond a certain threshold, it will check for wildcards on all the levels of the hosts for that IP iteratively.

Using Resolvers with dnsx

Here are some examples demonstrating how to configure dnsx with various resolvers:

Dnsx as a library

It’s possible to use the library directly in your golang programs. The following code snippets is an example of use in golang programs. Please refer to here for detailed package configuration and usage.