Check mail exchangers and their priorities for example.test with dig.
Keep the output concise.
Which command is appropriate?
MX records contain mail-exchanger hostnames and priorities. dig NAME MX +short prints them concisely.
Detailed explanation
dig example.test MX +shortCorrect. It queries the MX records and prints the short answer.
Correct. It queries the MX records and prints the short answer.
dig example.test A +shortIncorrect. A queries an IPv4 address.
Incorrect. A queries an IPv4 address.
dig example.test NS +shortIncorrect. NS queries authoritative name servers.
Incorrect. NS queries authoritative name servers.
dig example.test TXT +shortIncorrect. TXT queries text data.
Incorrect. TXT queries text data.
Try it yourself
An example you can run in a temporary verification environment.
dig -h 2>&1 | sed -n '1,8p'Expected result
digの問い合わせ型を指定できる使用方法Key points
- MX is mail exchanger
- The number is priority
- +short keeps answer output
Notes
- Environment: BIND dig help / 外部問い合わせなし
- 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.