A user wants to look up the mail exchange (MX) records for a domain. Which command should be used?
Trap 1: ping domain.com
ping sends ICMP echo requests and reports reachability, not DNS resource records, so it cannot return MX entries. It is tempting because it does resolve a hostname to an address, which suits confirming basic name resolution or connectivity, but querying mail exchanger records requires a DNS lookup tool.
Trap 2: host -t mx domain.com
host -t mx does query MX records, but the question's expected answer is the equivalent nslookup form; host is a valid alternative tool rather than the one this exam targets. It is tempting because it genuinely performs the required lookup, and would be correct where host is the available or preferred DNS utility.
Trap 3: nslookup -type=mx domain.com
nslookup -type=mx does query MX records, but the question's expected answer is the equivalent host form; nslookup is a valid alternative tool rather than the one this exam targets. It is tempting because it genuinely performs the required lookup, and would be correct where nslookup is the available or preferred DNS utility.
- A
dig domain.com MX
dig with the MX record type queries the domain's DNS zone specifically for mail exchange records, returning the mail servers and their priorities. This directly answers the lookup requirement, unlike an A or CNAME query.
- B
ping domain.com
Why it fails: ping sends ICMP echo requests and reports reachability, not DNS resource records, so it cannot return MX entries. It is tempting because it does resolve a hostname to an address, which suits confirming basic name resolution or connectivity, but querying mail exchanger records requires a DNS lookup tool.
- C
host -t mx domain.com
Why it fails: host -t mx does query MX records, but the question's expected answer is the equivalent nslookup form; host is a valid alternative tool rather than the one this exam targets. It is tempting because it genuinely performs the required lookup, and would be correct where host is the available or preferred DNS utility.
- D
nslookup -type=mx domain.com
Why it fails: nslookup -type=mx does query MX records, but the question's expected answer is the equivalent host form; nslookup is a valid alternative tool rather than the one this exam targets. It is tempting because it genuinely performs the required lookup, and would be correct where nslookup is the available or preferred DNS utility.