Use DNS to check the PTR record associated with 192.0.2.20.
Use host.
Which command is appropriate?
Passing an IPv4 address to host performs a reverse lookup using the corresponding in-addr.arpa name and PTR record.
Detailed explanation
host -t A 192.0.2.20Incorrect. A records map names to IPv4 addresses in a forward lookup.
Incorrect. A records map names to IPv4 addresses in a forward lookup.
host 20.2.0.192.in-addr.arpa AIncorrect. A reverse query uses PTR rather than A.
Incorrect. A reverse query uses PTR rather than A.
host 192.0.2.20Correct. host recognizes the IP argument and performs the PTR lookup.
Correct. host recognizes the IP argument and performs the PTR lookup.
hostname 192.0.2.20Incorrect. hostname changes or displays the local hostname, not DNS reverse data.
Incorrect. hostname changes or displays the local hostname, not DNS reverse data.
Try it yourself
An example you can run in a temporary verification environment.
host -h 2>&1 | sed -n '1,6p'Expected result
hostのname引数や問い合わせ型を示すhelpKey points
- An IP argument requests reverse lookup
- PTR records
- in-addr.arpa for IPv4
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.