A systems administrator is deploying a new email server and must confirm that external mail hosts can locate it. Which single command will query the DNS Mail Exchanger (MX) record for the domain "example.com" from a Windows or Unix command prompt?
The correct command is nslookup -type=mx example.com. The -type= switch (or its synonym -q= / -query= on many systems) sets the DNS record type to request. When set to MX, nslookup retrieves only Mail-Exchanger records for the specified domain, allowing the administrator to verify that email delivery should work.
The other options are incorrect:
nslookup mail.example.com issues a standard A/AAAA lookup for the host name, not the domain's MX record.
tracert example.com traces the route to a host; it does not query DNS records.
nslookup -type=mx mail.example.com requests MX records for the host "mail.example.com". Most hosts do not have their own MX records, so this does not validate the domain's MX configuration.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an MX record in DNS?
Open an interactive chat with Bash
What other DNS record types can `nslookup` query?
Open an interactive chat with Bash
Why is `tracert` not useful for querying DNS records?