Search for mail exchanger (MX) records using dig

Posted December 1, 2003 by Rex in BIND and DNS

Mail exchanger or MX records in DNS are used to route email for a domain. The dig utility makes it easy to search for this type of DNS record.


To search for the MX records for the domain tech-recipes.com, use:

dig mx tech-recipes.com

This will query the DNS server configured in your operating system. Often times it is useful to query against a different DNS server. To perform the same query above against the name server ns3.notarealdomain.com:

dig @ns3.notarealdomain.com mx tech-recipes.com

The Conversation

Follow the reactions below and share your own thoughts.