Explicitly query TXT records for example.test with host.
Which command is appropriate?
host -t TYPE NAME specifies the DNS record type. Use -t TXT to query TXT records.
Detailed explanation
host -t A example.testIncorrect. -t A queries IPv4 addresses.
Incorrect. -t A queries IPv4 addresses.
host -t TXT example.testCorrect. It selects TXT records for example.test.
Correct. It selects TXT records for example.test.
host --txt=example.testIncorrect. --txt= is not the standard host syntax.
Incorrect. --txt= is not the standard host syntax.
host example.test -q TXTIncorrect. -t is the standard record-type option.
Incorrect. -t is the standard record-type option.
Try it yourself
An example you can run in a temporary verification environment.
host -h 2>&1 | grep -E -- '-t' | head -n 1Expected result
-tでquery typeを指定することを示すhelp行Key points
- -t selects the query type
- TXT is explicit
- Distinguish A and MX
Notes
- Environment: BIND host 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.