Look up DNS records with dig

Query any DNS record type for a domain, with a compact answer or the full response including headers and TTLs.

LinuxnetworkDNSDiagnosticsLow risk
Run dig example.com A +short to get the IPv4 addresses for example.com in a clean list.

01Command

Command
$ dig example.com A +short

02What it does

The default output is verbose: QUESTION, ANSWER, and SERVER sections plus TTLs — useful for debugging, while +short gives just the values. Change the record type with the second argument: dig example.com MX +short, dig example.com TXT +short, or AAAA for IPv6. Query a specific resolver with @: dig example.com @1.1.1.1 — this is the key trick for telling propagation problems from caching, since your default resolver may hold an old cached answer. Reverse lookups use dig -x 1.2.3.4.

03Risk

RiskLow risk
Requirementsdig comes from the bind9-dnsutils (Debian/Ubuntu) or bind-utils (Fedora/RHEL) package

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • dig(1) — DNS lookup utility
    Ubuntu manpages · vendor-doc · 2026-09-17
    Evidence: The dig manual documents querying a name for a given type (A, MX, etc.) and the +short option to print a terse answer.

Last verified: 2026-09-17 · Category: Network

06Related solutions