← Knowledge Base
DNSReference note1 min read · updated 2026-11-27

DNS lookups with dig

Query records, choose the resolver, trace delegation and read the answer.

digdnsrecords
dig example.org                      # A record
dig example.org AAAA +short
dig example.org MX +short
dig example.org TXT +short
dig example.org NS +short
dig @1.1.1.1 example.org             # ask a specific resolver
dig -x 203.0.113.10 +short           # reverse lookup (PTR)
dig +trace example.org               # follow delegation from the root servers
dig example.org +noall +answer +ttlid

The number in the answer is the TTL (seconds a resolver may cache it). nslookup (also on Windows) and host give similar answers. On Windows PowerShell: Resolve-DnsName example.org -Type MX. If answers differ between resolvers, caches or split-horizon DNS are involved.