AWS Certified Advanced Networking – Specialty (ANS-C00) — Question 256

You need to find the public IP address of an instance that you're logged in to. What command would you use?

Answer options

Correct answer: D

Explanation

The correct command is option D because it properly accesses the instance metadata service over HTTP to retrieve the public IPv4 address. Option A incorrectly uses the FTP protocol, which is not supported for this metadata endpoint. Option B incorrectly utilizes the SCP command, which is not meant for accessing metadata, and option C uses the localhost address, which will not provide the instance's public IP address.