dig
Flexible DNS lookup utility.
KaliParrotLinuxpassive
pkg: dnsutils
dig queries DNS for any record type and is the standard tool for inspecting resolution, debugging zones and testing resolvers.
Syntax
dig [@resolver] {name} {type} [+options]
Example
dig +short example.com ANY
Concisely lists records for the domain; use specific types (A, MX, TXT, NS) for clarity.
Options & flags
What each switch does. Toggle them in the builder below to assemble a command.
Command builder
Tick options (and fill any values) to build a ready-to-copy command.
dig NAME
Usage examples
dig +short target.tld A
Just the IPv4 address(es).
dig @8.8.8.8 target.tld MX
Query Google DNS for mail records.
dig +trace target.tld
Trace resolution from the root.
dig -x 93.184.216.34
Reverse-lookup an IP to a hostname.
Advantages
- Precise control over record type and resolver
- Scriptable +short/+noall output
- Great for zone-transfer and DNSSEC testing
Disadvantages
- Syntax is terse for beginners
- ANY queries are often refused
- Resolver caching can mask changes
Tags
#dns#osint
Official docs: dig(1) ↗
Related commands
Frequently asked questions
What is dig used for?
dig queries DNS for any record type and is the standard tool for inspecting resolution, debugging zones and testing resolvers.
What is an example dig command?
A common example is: dig +short example.com ANY — Concisely lists records for the domain; use specific types (A, MX, TXT, NS) for clarity.
Is dig part of Kali Linux?
Yes. dig ships with Kali Linux (and Parrot OS). If missing, install it with: sudo apt install dnsutils.
What category of security tool is dig?
dig is a Information Gathering tool with a passive-risk profile when run against a live target.
Try recon tools live
Run real scans against a domain you control, stage by stage.