# DNS

## whois

IP/domain info, IP ranges:

```
$ whois [-h whois.example.com] example.com или 127.0.0.1
```

## dig

General:

```
$ dig [@dns.example.com] example.com [{any,a,mx,ns,soa,txt,...}]
$ dig -x example.com [+short] [+timeout=1]
```

* <https://viewdns.info/reverseip/>

Zone transfer:

```
$ dig axfr @dns.example.com example.com
$ for srv in `cat dns.txt`; do dig axfr "@$srv" example.com | grep "failed" > /dev/null 2>&1 || echo $srv; done
```

## nslookup

```
$ nslookup example.com [ns.example.com]
$ nslookup -type=ptr 127.0.0.1

$ nslookup
[> server dns.example.com]
> set q=mx
> example.com

$ nslookup
> set q=ptr
> 127.0.0.1
```

## DNS Amplification

Check:

```
$ host facebook.com ns.example.com

$ dig +short @ns.example.com test.openresolver.com TXT

$ for srv in `cat dns.txt`
do dig +short @$srv test.openresolver.com TXT |
grep "open-resolver-detected" && echo "[+] $srv" || echo "[-] $srv"
done

$ sudo nmap -Pn -sU -sV --script dns-recursion -iL dns.txt -p53

$ for srv in `cat dns.txt`
do sudo nmap -Pn -sU -sV --script dns-recursion $srv -p53 |
pipe> grep "enabled" && echo "[+] $srv" || echo "[-] $srv"
done

msf > use auxiliary/scanner/dns/dns_amp
```


---

# 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://ppn.snovvcra.sh/pentest/perimeter/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.
