Network Troubleshooting

A technician on Linux needs only the IP address that mail.example.com resolves to, with no headers or statistics. Which command does this?

Show the answer

Correct answerA. dig mail.example.com +short

AWhy this is right: The +short option trims dig output to just the answer value, which is the resolved address.

BWhy not this: The -x option performs a reverse lookup and needs an IP address, not a hostname.

CWhy not this: An MX query asks for mail exchanger records, not the address, and prints full default output.

DWhy not this: An NS query returns the domain's name servers, not the address of the host.

The +short option makes dig print only the answer data, here the address. An MX query returns mail exchanger records and still prints the full output by default.