> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/reconnaissance/active-reconnaissance-approach/projectdiscovery-tools/dnsx.md).

# dnsX

**dnsx** is an efficient DNS toolkit developed by [ProjectDiscovery](https://projectdiscovery.io/). It is designed to perform fast and flexible DNS queries.

* [GitHub Repository: dnsx](https://github.com/projectdiscovery/dnsx)
* [Public Resolvers List](https://github.com/trickest/resolvers/blob/main/resolvers.txt)

### **Installation & Setup**

To install **dnsx**, run the following command using **Go**:

```bash
GO111MODULE=on go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
```

To make `dnsx` globally accessible:

```bash
sudo cp ~/go/bin/dnsx /usr/local/bin
```

Verify installation:

```bash
dnsx -h
```

***

### **Usage Examples**

* **Basic DNS Resolution**

  ```bash
  echo "example.com" | dnsx -a
  ```
* **Resolve a List of Domains**

  ```bash
  dnsx -l domains.txt -a
  ```
* **Query Multiple Record Types (A, AAAA, CNAME, MX, TXT)**

  ```bash
  dnsx -l domains.txt -a -aaaa -cname -mx -txt
  ```
* **Wildcard and Bruteforce Subdomain Resolution**

  ```bash
  dnsx -w subdomains.txt -d example.com
  ```
* **Filter IPs Based on CIDR**

  ```bash
  dnsx -l domains.txt -a -resp-only -filter-resp "192.168.1.0/24"
  ```
* **Save Results in JSON Format**

  ```bash
  dnsx -l domains.txt -json -o results.json
  ```
* **Perform DNS Resolution Using a Custom Resolver List**

  ```bash
  dnsx -l domains.txt -a -r resolvers.txt
  ```
* **Extract Only Live Resolutions**

  ```bash
  dnsx -l domains.txt -a -resp
  ```
* **Check for Wildcard Subdomains**

  ```bash
  dnsx -d example.com -w subdomains.txt -a -o results.txt -t 50
  ```
* **Perform Reverse DNS Lookups on a Range of IPs**

  ```bash
  seq 192.168.1.1 192.168.1.255 | dnsx -ptr
  ```
* **Use a Specific Nameserver for Queries**

  ```bash
  dnsx -l domains.txt -a -ns 8.8.8.8
  ```
