Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
November 11, 2023 22:35
November 11, 2023 22:35
October 21, 2023 19:57
November 14, 2020 00:47
September 22, 2023 21:52
January 30, 2021 12:23
September 22, 2023 22:04
August 6, 2021 16:49
November 23, 2023 14:13
November 23, 2023 14:13


A fast and multi-purpose DNS toolkit designed for running DNS queries

Features β€’ Installation β€’ Usage β€’ Running `dnsx` β€’ Wildcard β€’ Notes β€’ Join Discord

dnsx is a fast and multi-purpose DNS toolkit designed for running various probes through the retryabledns library. It supports multiple DNS queries, user supplied resolvers, DNS wildcard filtering like shuffledns etc.



  • Simple and Handy utility to query DNS records.
  • A, AAAA, CNAME, PTR, NS, MX, TXT, SRV, SOA query support
  • DNS Resolution / Brute-force support
  • Custom resolver input support
  • Multiple resolver format (TCP/UDP/DOH/DOT) support
  • stdin and stdout support
  • Automatic wildcard handling support

Installation Instructions

dnsx requires go1.19 to install successfully. Run the following command to install the latest version:

go install -v


dnsx -h

This will display help for the tool. Here are all the switches it supports.

   -l, -list string      list of sub(domains)/hosts to resolve (file or stdin)
   -d, -domain string    list of domain to bruteforce (file or comma separated or stdin)
   -w, -wordlist string  list of words to bruteforce (file or comma separated or stdin)

   -a      query A record (default)
   -aaaa   query AAAA record
   -cname  query CNAME record
   -ns     query NS record
   -txt    query TXT record
   -srv    query SRV record
   -ptr    query PTR record
   -mx     query MX record
   -soa    query SOA record
   -axfr   query AXFR
   -caa    query CAA record
   -any    query ANY record

   -re, -resp          display dns response
   -ro, -resp-only     display dns response only
   -rc, -rcode string  filter result by dns status code (eg. -rcode noerror,servfail,refused)

   -cdn  display cdn name
   -asn  display host asn information

   -t, -threads int      number of concurrent threads to use (default 100)
   -rl, -rate-limit int  number of dns request/second to make (disabled as default) (default -1)

   -up, -update                 update dnsx to latest version
   -duc, -disable-update-check  disable automatic dnsx update check

   -o, -output string  file to write output
   -j, -json           write output in JSONL(ines) format
   -omit-raw, -or      omit raw dns response from jsonl output

   -hc, -health-check  run diagnostic check up
   -silent             display only results in the output
   -v, -verbose        display verbose output
   -raw, -debug        display raw dns response
   -stats              display stats of the running scan
   -version            display version of dnsx

   -retry int                number of dns attempts to make (must be at least 1) (default 2)
   -hf, -hostsfile           use system host file
   -trace                    perform dns tracing
   -trace-max-recursion int  Max recursion for dns trace (default 32767)
   -resume                   resume existing scan
   -stream                   stream mode (wordlist, wildcard, stats and stop/resume will be disabled)

   -r, -resolver string          list of resolvers to use (file or comma separated)
   -wt, -wildcard-threshold int  wildcard filter threshold (default 5)
   -wd, -wildcard-domain string  domain name for wildcard filtering (other flags will be ignored)

Running dnsx

DNS Resolving

Filter active hostnames from the list of passive subdomains, obtained from various sources:

subfinder -silent -d | dnsx -silent

Print A records for the given list of subdomains:

subfinder -silent -d | dnsx -silent -a -resp [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []

Extract A records for the given list of subdomains:

subfinder -silent -d | dnsx -silent -a -resp-only

Extract CNAME records for the given list of subdomains:

subfinder -silent -d | dnsx -silent -cname -resp [] [] [] [] []

Extract ASN records for the given list of subdomains:

subfinder -silent -d | dnsx -silent  -asn [AS13335, CLOUDFLARENET, US] [AS13335, CLOUDFLARENET, US] [AS13335, CLOUDFLARENET, US] [AS13335, CLOUDFLARENET, US] [AS13335, CLOUDFLARENET, US] [AS13335, CLOUDFLARENET, US]

Probe using dns status code on given list of (sub)domains:

subfinder -silent -d | dnsx -silent -rcode noerror,servfail,refused [NOERROR] [NOERROR] [NOERROR] [NOERROR] [NOERROR] [NOERROR] [NOERROR] [NOERROR] [NOERROR]

Extract subdomains from given network range using PTR query:

echo | dnsx -silent -resp-only -ptr

Extract subdomains from given ASN using PTR query:

echo AS17012 | dnsx -silent -resp-only -ptr

DNS Bruteforce

Bruteforce subdomains for given domain or list of domains using d and w flag:

dnsx -silent -d -w dns_worldlist.txt

Bruteforce targeted subdomain using single or multiple keyword input, as d or w flag supports file or comma separated keyword inputs:

dnsx -silent -d domains.txt -w jira,grafana,jenkins

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:

cat domains.txt | dnsx -silent -w jira,grafana,jenkins -d -

DNS Bruteforce with Placeholder based wordlist

$ cat tld.txt

dnsx -d google.FUZZ -w tld.txt -resp

      _             __  __
   __| | _ __   ___ \ \/ /
  / _' || '_ \ / __| \  / 
 | (_| || | | |\__ \ /  \ 
  \__,_||_| |_||___//_/\_\ v1.1.2 [] [] [] [] [] [] [] [] [] 

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.

dnsx -l subdomain_list.txt -wd -o output.txt

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.

package main

import (


func main() {
	// Create DNS Resolver with default options
	dnsClient, err := dnsx.New(dnsx.DefaultOptions)
	if err != nil {
		fmt.Printf("err: %v\n", err)

	// DNS A question and returns corresponding IPs
	result, err := dnsClient.Lookup("")
	if err != nil {
		fmt.Printf("err: %v\n", err)
	for idx, msg := range result {
		fmt.Printf("%d: %s\n", idx+1, msg)

	// Query
	rawResp, err := dnsClient.QueryOne("")
	if err != nil {
		fmt.Printf("err: %v\n", err)
	fmt.Printf("rawResp: %v\n", rawResp)

	jsonStr, err := rawResp.JSON()
	if err != nil {
		fmt.Printf("err: %v\n", err)


πŸ“‹ Notes

  • As default, dnsx checks for A record.
  • As default dnsx uses Google, Cloudflare, Quad9 resolver.
  • Custom resolver list can be loaded using the r flag.
  • Domain name (wd) input is mandatory for wildcard elimination.
  • DNS record flag can not be used when using wildcard filtering.
  • DNS resolution (l) and DNS brute-forcing (w) can't be used together.
  • VPN operators tend to filter high DNS/UDP traffic, therefore the tool might experience packets loss (eg. Mullvad VPN)

dnsx is made with πŸ–€ by the projectdiscovery team.