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.
dig example.test A +shortIncorrect. A queries an IPv4 address.
dig example.test NS +shortIncorrect. NS queries authoritative name servers.
dig example.test TXT +shortIncorrect. 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
MX record
A DNS record that identifies mail delivery hosts and their preference.
Authoritative server
A name server that publishes the authoritative data for a DNS zone.
+short
A dig display option that prints a concise query result.