GO KALI FREE

DNSenum

Information Gathering

Beginnermedium risk

DNSenum is a multithreaded Perl script for DNS enumeration that discovers DNS records, attempts zone transfers, brute-forces subdomains, and performs reverse lookups. It is a foundational reconnaissance tool in Kali Linux for mapping a target domain's DNS infrastructure.

Installation

sudo apt install dnsenum

Basic Syntax

dnsenum [options] <domain>

Quick Facts

Tool Type
DNS Enumeration Script
Language
Perl
Category
Information Gathering
Difficulty
Beginner
Platform
Linux (Kali), macOS, Termux
Common Usage
DNS Reconnaissance & Subdomain Discovery
Risk Level
Medium (Active)
Key Feature
Zone Transfer + Brute Force

Tool Overview

DNSenum is a multithreaded Perl script designed for DNS enumeration that combines record gathering, zone transfer attempts, subdomain brute-forcing, and reverse DNS lookups into a single automated workflow. It is one of the most widely used dnsenum kali linux tools for mapping a target domain's DNS infrastructure during the reconnaissance phase of penetration testing.

The dnsenum command works by querying authoritative DNS servers for a domain and extracting A, AAAA, MX, NS, SOA, TXT, and CNAME records. It then attempts a DNS zone transfer (AXFR request) to retrieve the complete zone file, which can reveal every registered subdomain. If the zone transfer fails — which is common on modern DNS configurations — DNSenum falls back to dictionary-based subdomain brute-forcing to discover hidden hosts.

DNSenum is commonly used in Kali Linux for OSINT investigations, penetration testing reconnaissance, brand protection monitoring, and infrastructure mapping. Security professionals use it to identify the attack surface of a target domain by discovering all publicly accessible subdomains, mail servers, and name servers. For a complete DNS record analysis, combine DNSenum results with DNS Lookup to query individual record types in detail.

The tool supports multi-threaded scanning with the --threads flag, custom wordlists for subdomain brute-force with -f, custom DNS resolvers with --dnsserver, and reverse DNS lookups to map IP addresses back to hostnames. For subdomains not found through DNS enumeration, pair DNSenum with Subfinder for passive subdomain discovery from multiple data sources.

Understanding DNS enumeration is essential for cybersecurity professionals because DNS is the backbone of internet infrastructure. Every web service, email server, and API endpoint has a DNS record that can be discovered through systematic enumeration. The dnsenum kali linux tutorial approach teaches you to map this infrastructure methodically, from basic record gathering to advanced zone transfer techniques and subdomain brute-force strategies.

Common Commands

dnsenum example.comRun the default enumeration workflow against a domain
dnsenum --enum example.comConvenience mode equal to --threads 5 -s 15 -w
dnsenum -hDisplay the help message with all options
dnsenum --threads 10 example.comIncrease the number of concurrent query threads
dnsenum -f /usr/share/dnsenum/dns.txt example.comBrute-force subdomains using a named wordlist
dnsenum -f /path/to/file example.comBrute-force subdomains from a custom dictionary file
dnsenum -r example.comRecurse into discovered subdomains that have NS records
dnsenum --dnsserver 10.10.10.10 example.comForce A, NS, and MX queries through a specific DNS server
dnsenum -w example.comPerform whois queries on discovered class C netranges
dnsenum -o results.xml example.comSave the full run to an XML file (MagicTree-compatible)
dnsenum -p 10 -s 20 example.comScrape more Google result pages and subdomains
dnsenum -s 30 example.comSet the maximum number of subdomains scraped from Google
dnsenum --private example.comShow and save private (RFC1918) IPs to domain_ips.txt
dnsenum --subfile subs.txt example.comWrite every valid subdomain found to a file
dnsenum --noreverse example.comSkip reverse-lookup operations on netranges

Step-by-Step Guide

  1. 1Select the target domain you want to investigate and ensure you have authorization to enumerate its DNS infrastructure
  2. 2Run a basic DNSenum scan: dnsenum <domain> to collect initial DNS records and attempt zone transfers
  3. 3Review the discovered A records, NS records, MX records, and SOA records from the initial scan output
  4. 4Check whether the zone transfer attempt succeeded or was denied — most modern servers block unauthorized AXFR requests
  5. 5Supply a custom wordlist with -f to brute-force additional subdomains that are not publicly listed in DNS records
  6. 6Examine reverse DNS lookup results to map IP addresses back to hostnames and identify additional infrastructure
  7. 7Record all discovered subdomains, IP addresses, and mail servers for use with subsequent enumeration tools
  8. 8Cross-reference findings with DNS Lookup records and Whois Lookup data to build a complete domain profile

Warnings

Use Cases

DNS Record Enumeration

Gather A, AAAA, MX, NS, SOA, TXT, and CNAME records for a target domain to understand its DNS infrastructure configuration.

Zone Transfer Attempts

Test whether a target DNS server permits unauthorized zone transfers (AXFR) that reveal the complete list of registered subdomains.

Subdomain Brute Force

Discover hidden subdomains using dictionary-based attacks when zone transfers are denied, finding hosts not listed in public DNS.

Reverse DNS Lookups

Map discovered IP addresses back to hostnames using PTR records, identifying additional infrastructure and shared hosting arrangements.

Mail Server Discovery

Identify MX records and mail server configurations to understand email infrastructure and potential social engineering targets.

OSINT Reconnaissance

Build a comprehensive profile of a target domain's infrastructure for open-source intelligence investigations and security assessments.

Key Features

Comparison

DNSenum vs Dig vs Fierce — DNS Recon Feature Matrix

FeatureDNSenumDigFierce
Primary purposeAll-in-one DNS enumerationPrecise single-record queriesSubdomain/zone discovery
Zone transfer (AXFR)Automatic attemptManual (dig axfr)Automatic attempt
Subdomain brute-forceYes (-f wordlist)NoYes (built-in)
Reverse DNS sweepYes (--enum)Yes (dig -x)Yes (range scan)
Multi-threadedYes (--threads)NoLimited
Best for beginnersYes — one commandNo — DNS expertiseYes

Active vs Passive DNS Discovery — When to Use Each

FeatureDNSenumSubfinderAmasstheHarvester
Query methodActive (direct)Passive (APIs)BothPassive (OSINT)
Touches target DNSYesNoOptionalNo
Detection riskMediumVery lowLow–mediumVery low
Data sourcesLive DNS + wordlist40+ sources80+ sourcesSearch engines
Zone transfer testingYesNoNoNo
Best combined roleActive verificationFast passive sweepDeep mappingEmail + host OSINT

DNSenum Aggression & Speed Tuning

FeatureStealthBalancedAggressive
Example commanddnsenum --noreverse --threads 2dnsenum --enumdnsenum -f big.txt --threads 20
Thread count1–25 (default enum)15–30
Wordlist sizeNone / tinyTop 5k1M+
SpeedSlowModerateFast
Detection riskLowMediumHigh
Use whenMonitored productionMost engagementsAuthorized labs

Best Practices

Common Errors

dnsenum: command not found
Install it with sudo apt update && sudo apt install dnsenum on Debian/Kali/Ubuntu. If you cloned the repo, run it directly with perl dnsenum.pl <domain> from the source directory.
Can't locate Net/DNS.pm in @INC
Install the Perl dependencies: sudo apt install libnet-dns-perl libstring-random-perl libxml-writer-perl, or install via CPAN with sudo cpan Net::DNS String::Random XML::Writer.
Zone transfer failed / AXFR refused
Treat this as expected. Fall back to subdomain brute-force with -f <wordlist>. Zone transfer success is a rare misconfiguration, not a requirement for enumeration.
No nameservers found for <domain>
Verify the domain resolves with dig NS <domain> or host <domain>. Check your /etc/resolv.conf, or force a public resolver with --dnsserver 8.8.8.8.
Scan hangs or is extremely slow
Add --noreverse to skip reverse lookups, raise --threads (e.g. --threads 10) for parallelism, and use --timeout to cap slow queries. Split very large wordlists.
Empty or minimal results returned
Supply a real wordlist with -f, e.g. -f /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt. Pair with Subfinder for passive sources DNSenum cannot reach.
use of uninitialized value / Perl warnings during scan
Update with sudo apt install --only-upgrade dnsenum, or pull the latest script from the official GitHub repo. Redirect stderr with 2>/dev/null if warnings obscure results.
Reverse lookups only show public IPs (private ranges skipped)
Add the --private flag to include private IP ranges in reverse lookups when you are authorized to map internal infrastructure.
Wordlist file not found / can't open file
Confirm the wordlist exists with ls -l <path>. Install SecLists with sudo apt install seclists, then reference /usr/share/seclists/Discovery/DNS/.
Getting rate-limited or temporarily blocked by the resolver
Lower --threads, add --timeout to pace requests, and query the domain's authoritative server directly with --dnsserver instead of a shared public resolver.
google scraping returns no subdomains
Do not depend on scraping. Use dictionary brute-force (-f) plus passive tools like Subfinder, Amass, and theHarvester for subdomain coverage.
Results contain stale or dead subdomains
Validate discovered hosts by piping them through httpx or curl -I to confirm HTTP status before acting on them. Flag dangling records as possible subdomain-takeover candidates.

People Also Ask

What is the difference between DNSenum and Subfinder?

DNSenum actively queries DNS servers, attempts zone transfers, and brute-forces subdomains, making it an active reconnaissance tool. Subfinder is passive-only — it queries public sources like certificate transparency logs and never sends traffic to the target. Use DNSenum for active DNS testing; use Subfinder for stealthy passive enumeration.

Does DNSenum support zone transfer attacks?

Yes. DNSenum attempts DNS zone transfer (AXFR) against name servers discovered for the target domain. A successful zone transfer reveals the entire DNS zone file, including all subdomains, IP addresses, and record types. Use --noreverse to skip reverse lookups and focus on zone transfer attempts.

How do I use DNSenum with a custom wordlist?

Use the -f flag to specify a custom wordlist for subdomain brute-forcing: dnsenum -f /usr/share/wordlists/subdomains.txt example.com. For comprehensive results, combine with --threads N for multi-threaded scanning and --subfile output.txt to save discovered subdomains.

Is DNSenum safe to use?

DNSenum is safe to use on domains you own or have explicit authorization to test. It is an active tool that sends DNS queries to target servers, which may be logged and detected. Unauthorized DNS enumeration may violate computer fraud laws. Always obtain written permission before scanning domains you do not own.

What DNS record types does DNSenum discover?

DNSenum discovers A, AAAA, MX, NS, SOA, TXT, and CNAME records. It also performs reverse DNS lookups to map IP addresses back to hostnames and attempts zone transfers to retrieve the complete zone file from misconfigured name servers.

How does DNSenum compare to Nmap for DNS enumeration?

DNSenum is specialized for DNS enumeration — it focuses on DNS records, zone transfers, and subdomain brute-forcing with multi-threaded performance. Nmap has broader capabilities including port scanning, service detection, and OS fingerprinting but is less focused on DNS-specific tasks. Use DNSenum for DNS recon, then Nmap for port scanning discovered hosts.

Learning Path

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Related Tools

Dig

Information Gathering

DNS query tool for detailed record lookups with TTL, flags, and authoritative response data.

Subfinder

Information Gathering

Passive subdomain discovery tool using 40+ public data sources without querying the target.

Whois Lookup

Information Gathering

Query domain registration data including registrar, owner, creation date, and expiration.

Amass

Information Gathering

OWASP subdomain discovery tool combining passive and active techniques for large-scale domain mapping.

theHarvester

Information Gathering

OSINT tool for gathering emails, subdomains, and employee names from public sources.

Nikto

Web Application

Web server scanner for detecting misconfigurations, outdated software, and dangerous files.

Frequently Asked Questions

What is DNSenum?

DNSenum is a multithreaded Perl script for DNS enumeration that gathers DNS records (A, AAAA, MX, NS, SOA, TXT, CNAME), attempts zone transfers (AXFR), brute-forces subdomains, and performs reverse DNS lookups. It is a standard reconnaissance tool in Kali Linux used for mapping a target domain's DNS infrastructure during penetration testing and OSINT investigations.

What does DNSenum do?

DNSenum performs four main functions: (1) gathers DNS records including A, AAAA, MX, NS, SOA, TXT, and CNAME records; (2) attempts DNS zone transfer to retrieve the complete zone file; (3) brute-forces subdomains using dictionary attacks; and (4) performs reverse DNS lookups to map IP addresses back to hostnames. These capabilities make DNSenum a comprehensive DNS reconnaissance tool.

How do I use DNSenum?

Install DNSenum with sudo apt install dnsenum, then run dnsenum <domain> for basic enumeration. Use --enum for full enumeration with reverse lookups, -f wordlist.txt for custom subdomain brute-force, --threads N for multi-threaded scanning, and --noreverse to skip reverse lookups. Save output with > output.txt and discovered subdomains with --subfile subs.txt.

How do I use DNSenum in Kali Linux?

DNSenum comes pre-installed on Kali Linux. Open a terminal and run sudo apt install dnsenum to ensure it is installed. Then use dnsenum <domain> for basic enumeration. For a complete dnsenum kali linux tutorial, start with dnsenum example.com, review the output, then try dnsenum --enum example.com for full enumeration with reverse lookups and subdomain discovery.

What is DNSenum used for?

DNSenum is used for DNS reconnaissance during penetration testing and OSINT investigations. It maps a target's DNS infrastructure by discovering subdomains, mail servers, name servers, and IP addresses. Security professionals use it to identify the attack surface, test for zone transfer vulnerabilities, and build comprehensive domain profiles for further analysis with tools like Nmap, Nikto, and Gobuster.

Is DNSenum safe?

DNSenum is safe to use on domains you own or have explicit authorization to test. It is an active tool that sends DNS queries to target servers, which may be logged and detected. Unauthorized DNS enumeration may violate computer fraud laws. Always obtain written permission before scanning domains you do not own. Use lab environments like HackTheBox or TryHackMe for practice.

What DNS records can DNSenum discover?

DNSenum discovers A records (IPv4 addresses), AAAA records (IPv6 addresses), MX records (mail servers with priority), NS records (authoritative name servers), SOA records (start of authority with zone metadata), TXT records (text annotations including SPF/DKIM), and CNAME records (canonical name aliases). It also discovers subdomains through zone transfer attempts and brute-force enumeration.

Can DNSenum find subdomains?

Yes, DNSenum discovers subdomains through two methods: zone transfer attempts (AXFR requests that may return the complete zone file) and dictionary-based brute-force using the -f flag. Zone transfers are rarely permitted on modern DNS servers, so subdomain brute-force is the primary discovery method. Use comprehensive wordlists from SecLists for the best results.

What is DNSenum brute force?

DNSenum brute force is a dictionary-based subdomain discovery technique that queries the target DNS server with thousands of potential subdomain names from a wordlist. When a subdomain exists, the DNS server responds with its IP address. Use dnsenum -f wordlist.txt <domain> to specify a custom wordlist. The default wordlist is small — download SecLists for comprehensive discovery with 5000+ entries.

What is DNSenum reverse lookup?

DNSenum reverse lookup (PTR record query) maps discovered IP addresses back to hostnames. This reveals additional infrastructure, shared hosting arrangements, and hostnames not found through forward DNS enumeration. Enable reverse lookups with dnsenum --enum or disable them with --noreverse for faster scanning. Reverse DNS is essential for complete infrastructure mapping.

What is DNSenum zone transfer?

A DNS zone transfer (AXFR) is a mechanism for replicating DNS zone files between servers. DNSenum attempts to request a zone transfer from the target's primary name server, which if successful returns the complete list of all registered subdomains and DNS records. Most modern DNS servers block unauthorized zone transfers, so this is a security test as well as an enumeration technique.

How do I install DNSenum on Kali Linux?

DNSenum is included in Kali Linux by default. Run sudo apt install dnsenum to install or update it. On other Linux distributions, you can clone it from GitHub: git clone https://github.com/fwaeyt/dnsenum.git, then run it with perl dnsenum.pl <domain>. No additional dependencies are required beyond Perl, which is pre-installed on most systems.

What is the difference between DNSenum and Dig?

DNSenum automates the entire enumeration workflow — gathering records, testing zone transfers, and brute-forcing subdomains in a single command. Dig requires manual queries for each record type but provides more detailed output including TTL values, record flags, and authoritative response data. Use DNSenum for rapid discovery and Dig for deep analysis of specific records.

What are common DNSenum errors and how do I fix them?

Common DNSenum errors include: 'NXDOMAIN' (domain doesn't exist — check spelling), 'REFUSED' (DNS server blocks queries — try different resolver with --dnsserver), 'timed out' (increase --timeout value), and empty zone transfer results (target blocks AXFR — this is normal, use -f for brute-force instead). If DNSenum hangs, reduce --threads or add --noreverse to skip reverse lookups.

What beginner mistakes should I avoid with DNSenum?

Avoid these common mistakes: (1) Not using a wordlist — the default wordlist is tiny, always use -f with SecLists. (2) Expecting zone transfers to succeed — most servers block AXFR, treat it as a bonus. (3) Not saving output — redirect results with > or use --subfile. (4) Running without authorization — always get permission first. (5) Ignoring rate limits — too many threads get you blocked, start with --threads 5.

What are the best DNSenum alternatives?

Top DNSenum alternatives include: Dig (detailed manual DNS queries), Subfinder (passive subdomain discovery from 40+ sources), Amass (large-scale domain mapping with OWASP backing), dnsrecon (Python-based with SRV and cache snooping), and gobuster DNS mode (fast concurrent subdomain brute-force). Use DNSenum for combined zone transfer + brute-force, and Subfinder or Amass for larger-scale reconnaissance.

How do I use dnsenum with a custom DNS server?

Use the --dnsserver flag to specify a custom DNS resolver: dnsenum --dnsserver 8.8.8.8 example.com. This is useful when the default system resolver cannot reach the target's authoritative nameservers, or when you want to query from a specific geographic location. You can also use 1.1.1.1 (Cloudflare) or other public resolvers.

What does the --reverse flag do in dnsenum?

The --reverse flag enables reverse DNS lookups (PTR record queries) that map discovered IP addresses back to hostnames. This reveals additional infrastructure like shared hosting servers and hostnames not found through forward DNS. Use --noreverse to disable reverse lookups for faster scanning when IP-to-hostname mapping is not needed.

Can dnsenum discover subdomains from certificate transparency logs?

Dnsenum does not directly query certificate transparency logs. For certificate transparency subdomain discovery, combine dnsenum with tools like crt.sh (queried via curl or theHarvester with -b crtsh). Use dnsenum for DNS record gathering and zone transfer testing, then supplement with certificate transparency sources for comprehensive subdomain coverage.

What is the difference between dnsenum and dnsrecon?

Dnsenum focuses on DNS record gathering, zone transfer attempts, and subdomain brute-forcing in a single automated workflow. Dnsrecon offers more granular control over individual DNS queries, supports SRV record enumeration, and provides multiple output formats. Dnsenum is better for quick comprehensive scans; dnsrecon is better for targeted DNS research and SRV record discovery.

How do I use dnsenum to enumerate mail servers?

DNSenum automatically discovers MX records in its standard output. Run dnsenum <domain> and review the MX section for mail server hostnames and priorities. For deeper email infrastructure analysis, combine with dig MX <domain> +short to see all mail exchangers and their preference values, then investigate each with WHOIS.

Can dnsenum enumerate IPv6 addresses?

Yes, DNSenum discovers AAAA records (IPv6 address records) alongside standard A records. Run dnsenum <domain> and look for AAAA entries in the DNS Records section. IPv6 enumeration is important for modern infrastructure mapping since many services run dual-stack configurations.

How do I integrate dnsenum results with Nmap?

Save dnsenum subdomains to a file with --subfile subs.txt, then use Nmap to scan them: nmap -iL subs.txt -sV -oN nmap_results.txt. This workflow maps DNS infrastructure first, then probes each discovered host for open ports and running services. Combine with grep to extract IP addresses from dnsenum output for targeted Nmap scans.

What DNS servers does dnsenum query by default?

DNSenum queries the target domain's authoritative name servers by default, which it discovers from NS records. If the system's default resolver is used, it may query your ISP's DNS instead. Use --dnsserver 8.8.8.8 to force queries through a specific resolver, or query each NS individually with --dnsserver for thorough zone transfer testing.

Can dnsenum be used for bug bounty reconnaissance?

Yes, dnsenum is valuable for bug bounty reconnaissance. Use it to discover subdomains that host development, staging, or internal applications that may have weaker security. Run dnsenum -f subdomains-top1million-5000.txt to find hidden hosts, then test each for vulnerabilities. Combine with Subfinder for passive subdomain discovery to maximize coverage without triggering security alerts.

How do I interpret dnsenum zone transfer results?

When a zone transfer succeeds, dnsenum lists every registered subdomain with its IP address. Look for entries pointing to internal IP ranges (10.x, 172.16-31.x, 192.168.x) that indicate internal infrastructure exposed through DNS. A failed zone transfer message ('Zone transfer failed') is normal — most modern DNS servers block unauthorized AXFR requests. Treat zone transfer success as a critical finding in your security report.

How does dnsenum compare to fierce for DNS enumeration?

DNSenum provides a more complete workflow by combining record gathering, zone transfer testing, and subdomain brute-forcing in a single command. Fierce focuses specifically on subdomain discovery and adjacent IP range identification. DNSenum is better for comprehensive DNS profiling, while Fierce excels at identifying hosts on neighboring IP addresses that may be part of the target infrastructure.

What wordlist is best for dnsenum subdomain brute-force?

For comprehensive results, use SecLists DNS wordlists: dnsenum -f /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt <domain>. The built-in wordlist is small and misses common subdomains like api, staging, dev, and admin. For targeted engagements, create custom wordlists using company names, product names, and industry terms. Combine CeWL wordlist generation with dnsenum for maximum effectiveness.

Is DNSenum still maintained, and what should I use instead?

The original DNSenum (by Filip Waeytens and Barbsie) is stable but only lightly maintained, and Google scraping for subdomains is largely broken by modern anti-bot measures. It remains excellent for zone-transfer testing and dictionary brute-force. For actively developed alternatives, pair it with Subfinder and Amass for passive discovery, or dnsrecon for a Python-based option with SRV and cache-snooping features.

How do I detect wildcard DNS before brute-forcing with DNSenum?

Wildcard DNS makes every subdomain guess resolve, flooding your results with false positives. Detect it by querying a random, definitely-nonexistent subdomain first — for example dig randomstring12345.example.com. If it returns an A record, the domain uses a wildcard. When a wildcard is present, filter results by comparing against the wildcard IP, or rely on passive sources like Subfinder instead of brute-force.

Does DNSenum work over IPv6 and can it find AAAA records?

Yes. DNSenum queries AAAA records as part of its standard record gathering, so IPv6 hosts appear in the output alongside IPv4 A records. Reverse lookups can also cover IPv6 ranges, though these are often sparse. For granular IPv6 record inspection with TTL and authoritative flags, follow up with Dig using dig AAAA example.com.

How does DNSenum compare to dig for DNS reconnaissance?

DNSenum is an all-in-one enumeration script: it gathers records, attempts zone transfer, brute-forces subdomains, and runs reverse lookups automatically. Dig is a precise, single-query tool that gives granular control over record types, TTL, flags, and authoritative answers. Use DNSenum to map a domain quickly, then use Dig to inspect specific records in depth. They complement each other rather than compete.

Tags

#reconnaissance#dns-enumeration#subdomain-bruteforce#zone-transfer#osint

Output Explanation

DNSenum output displays discovered A records (host IP addresses), AAAA records (IPv6 addresses), MX records (mail servers with priority), NS records (authoritative name servers), SOA records (start of authority with serial and refresh data), TXT records (text annotations including SPF and DKIM), CNAME records (canonical name aliases), and any subdomains found through zone transfer attempts or dictionary brute-forcing. Reverse DNS results show PTR records mapping IP addresses back to hostnames.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.