+short is one of the most useful dig options. It prints the returned data without the full header, question section, authority section, or timing details.
dig example.com A +shortGood uses for +short
- Checking whether an A record returns the expected IP address.
- Using dig in a script where only the value matters.
- Comparing a small number of resolvers quickly.
- Copying a clean value into a support ticket.
When +short hides the problem
A blank +short result can mean several different things: the record type does not exist, the name does not exist, the server failed, or the query was refused. The short output alone does not tell you which one happened.
Use full output when the answer is empty
dig example.com A
dig example.com A +noall +answerIf the answer is empty, look for the status code. NOERROR with no answer usually means the name exists but not for that record type. NXDOMAIN means the name itself does not exist.