Query the A record for app.example.test.
Omit headers, question details, and statistics so only a concise answer value is shown.
Which command is appropriate?
dig +short suppresses the usual explanatory sections and prints a compact answer suitable for scripts.
Detailed explanation
dig +stats app.example.test AIncorrect. +stats enables statistics rather than suppressing them.
Incorrect. +stats enables statistics rather than suppressing them.
dig +comments app.example.test AIncorrect. +comments displays comment lines.
Incorrect. +comments displays comment lines.
dig +short app.example.test ACorrect. +short prints the answer in compact form.
Correct. +short prints the answer in compact form.
dig +question app.example.test AIncorrect. +question displays the question section.
Incorrect. +question displays the question section.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '+short -> concise answer values'Expected result
+short -> concise answer valuesKey points
- Use +short
- Show a concise answer
- Different from +stats
Notes
- Environment: dig option対応表(DNS通信なし)
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.