DNS 53

Nmap Enumeration

Basic Scan for DNS

nmap -p 53 <target_range> -vv -oA dns.txt

Where <target_range> could be a single IP (e.g., 10.10.10.10) or a range (e.g., 10.11.1.1-254).


Finding the DNS Server

Using nslookup

nslookup <hostname> <dns_server_ip>

Using dig

Basic Queries:

dig @<dns_server_ip> <hostname>

Reverse Lookup:

dig -x <ip_address> +short

Forward Lookup Bruteforce

Using dnsrecon

Install dnsrecon:

Run a forward lookup brute force:

Using dnsmap

Install dnsmap:

Run DNS enumeration:

Using host

For a basic lookup:

For specific records:

Automating Forward Lookups with Bash

Prepare a list of subdomains (e.g., list.txt):

Run the following script:


Reverse Lookup Bruteforce

Using Bash

For a range of IPs:

Using dnsrecon

Reverse lookup brute force:


DNS Zone Transfers

Using host

Check for a vulnerable zone transfer:

Using dnsrecon

Using dnsenum

Install dnsenum:

Run zone transfer:


Common Use Cases

  1. Forward Lookups: Identify valid subdomains and their associated IPs.

  2. Reverse Lookups: Discover hostnames for a given range of IPs.

  3. Zone Transfers: Exploit misconfigured DNS servers to dump entire domain records.

  4. Brute Forcing: Use wordlists to uncover hidden or forgotten subdomains.


Custom Wordlists

You can use wordlists from the SecLists repository for DNS brute-forcing:

Example location:

Last updated