Use host to query the MX records for example.test.
Which command is appropriate?
host -t TYPE NAME selects a record type explicitly; MX returns mail exchanger names and their priorities.
Detailed explanation
host -t A example.testIncorrect. A returns IPv4 address records.
Incorrect. A returns IPv4 address records.
host -t PTR example.testIncorrect. PTR is used for reverse mapping.
Incorrect. PTR is used for reverse mapping.
host -t NS example.testIncorrect. NS returns authoritative name servers.
Incorrect. NS returns authoritative name servers.
host -t MX example.testCorrect. It queries the MX records for the domain.
Correct. It queries the MX records for the domain.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'host -t MX example.test -> mail exchanger records'Expected result
host -t MX example.test -> mail exchanger recordsKey points
- -t selects the type
- MX means mail exchanger
- Check priority too
Notes
- Environment: host構文の表示のみ(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.