What command finds only mail server records

To find only mail server records (also known as MX records) using the dig command, you can use the following syntax:

dig +short mx example.com

This will return only the MX records for the domain example.com.

Here's a breakdown of the options used:

You can also use the -t option to specify the record type explicitly:

dig -t mx example.com +short

This will achieve the same result as the previous command.

Note that if you want to retrieve all DNS records for a domain, including MX records, you can use the following command:

dig +short example.com

This will return all DNS records for the domain, including A records, NS records, SOA records, and more.