Dig: Difference between revisions
Jump to navigation
Jump to search
Created page with "= dig = '''dig''' (Domain Information Groper) is a powerful command-line DNS lookup tool used to query DNS name servers and retrieve resource records. It is commonly used in reconnaissance to resolve hostnames, enumerate DNS records, test custom name servers, and analyze DNS responses in detail. == <span id="options"></span>Common Options == === Basic Queries === {| class="wikitable" ! Option !! Description |- | <code>A</code> || Query IPv4 address record..." |
(No difference)
|
Revision as of 23:32, 29 May 2025
dig
dig (Domain Information Groper) is a powerful command-line DNS lookup tool used to query DNS name servers and retrieve resource records. It is commonly used in reconnaissance to resolve hostnames, enumerate DNS records, test custom name servers, and analyze DNS responses in detail.
Common Options
Basic Queries
Option | Description |
---|---|
A |
Query IPv4 address record |
AAAA |
Query IPv6 address record |
MX |
Query mail exchange record |
NS |
Query authoritative name servers |
CNAME |
Query canonical name record (alias) |
SOA |
Query start of authority record |
TXT |
Query text records (commonly used for SPF, DKIM, etc.) |
Query Control
Option | Description |
---|---|
@[SERVER] |
Specify DNS server to query |
+short |
Return simplified output (good for scripts) |
+noall |
Suppress all sections of the output |
+answer |
Show only the answer section |
+timeout=[SEC] |
Set query timeout in seconds |
+tries=[NUM] |
Set number of query attempts |
+tcp |
Use TCP instead of UDP for the query |
+nocomments |
Omit comments from output |
Examples
Query A Record
dig A example.com
Query AAAA Record
dig AAAA example.com
Query MX Records
dig MX example.com
Query Name Servers
dig NS example.com
Query CNAME Record
dig CNAME www.example.com
Query SOA Record
dig SOA example.com
Query TXT Records
dig TXT example.com
Use Specific DNS Server
dig @8.8.8.8 A example.com
Simplified Output
dig +short A example.com
Show Only Answer Section
dig +noall +answer A example.com
Set Timeout
dig +timeout=2 A example.com
Set Number of Retries
dig +tries=1 A example.com
Force TCP Query
dig +tcp A example.com