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.
01Command
$ dig example.com A +short02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- dig(1) — DNS lookup utilityEvidence: 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
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.
Show every TCP and UDP socket in listening state with the owning process name and PID — the modern replacement for netstat.
Send a HEAD request to any URL and print the status line, server, content type, caching, and redirect headers.