DNS lookups often include headers, flags, timing, and resolver metadata that are helpful during troubleshooting but noisy when only the returned record values matter. dig +short keeps the output focused on the answer data, which makes address, mail, and text-record checks easier to paste into tickets, scripts, and change notes.
The +short option changes dig from the normal verbose display to terse answers. Address queries print only addresses, MX queries print priority plus exchanger, and TXT queries print quoted text strings without the question, authority, statistics, or comment sections.
A blank short result means dig received no answer rows to print for that name and type. Use the full dig output when the difference between NXDOMAIN, NOERROR with no data, SERVFAIL, and a timeout changes the next action.
Related: How to query DNS records with dig
Related: How to compare DNS answers across resolvers with dig
Tool: DNS Record Lookup
Steps to show short DNS answers with dig:
- Print only the A record values for a hostname.
$ dig +short example.com A 172.66.147.243 104.20.23.154
+short removes the owner name, TTL, record class, record type, status line, and query statistics from the normal dig output.
- Print only the AAAA record values when the IPv6 address set is the target.
$ dig +short example.com AAAA 2606:4700:10::ac42:93f3 2606:4700:10::6814:179a
A short address lookup can return multiple lines when the name has more than one answer value.
- Show mail exchangers in compact form.
$ dig +short example.com MX 0 .
MX short output keeps the preference value before the exchanger name. The single dot is a null mail exchanger, which tells senders that the domain does not accept mail.
- Show text records without the full DNS response envelope.
$ dig +short example.com TXT "v=spf1 -all" "_k2n1y4vw3qtb4skdx9e7dxt97qrmmq9"
TXT output remains quoted because quoted strings are part of the DNS text-record presentation format.
- Check a missing name and treat an empty result as no printable answer rows.
$ dig +short missing-record.example.com A
No output from +short is not a complete status diagnosis. Run a normal dig query when the exact response code matters.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.