# 53 ) DNS

* DNS Reverse lookup

```bash
nslookup
SERVER IP
127.0.0.1
127.0.0.2
bank.htb
IP
```

* DNSRecon

```bash
dnsrecon -r 127.0.0.0/24 -d 10.10.10.29
dnsrecon -r 10.10.10.0/24 -d 10.10.10.29
```

* DNS Zone Transfer

```bash
dig axfr @10.10.10.29
dig axfr bank.htb @10.10.10.29
```

* Config Files

```bash
nano /etc/resolv.conf
# Then add nameserver ex : 10.10.10.29
```

* Subdomain Brute Forcing

```bash
for sub in $(cat /usr/share/SecLists/Discovery/DNS/subdomains-top1million-110000.txt);do dig $sub.<DOMAIN> @<IP> | grep -v ';\|SOA' | sed -r '/^\s*$/d' | grep $sub | tee -a subdomains.txt;done   

dnsenum --dnsserver <IP> --enum -p 0 -s 0 -o subdomains.txt -f /usr/share/SecLists/Discovery/DNS/subdomains-top1million-110000.txt <DOMAIN>     
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://p0db0t.gitbook.io/pentest/tcp/53-dns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
