DNS Records Management: What About Mail?

Last year I addressed how you should check EDNS for strange DNS issues, and earlier this year I began a three-part series on DNS Records Management. If you haven’t already, feel free to read my first post on getting started with DNS. As a quick recap, we are diving into what Domain Name System records management means and how to use it.

Today, as I continue this DNS records management series, we’ll be touching on records typically reserved for email: MX Records. So without further ado, let’s dive in:

MX Records

The MX record or Mail eXchanger record is essentially how you tell the internet where your email lives.

Again this is a pointer, but a pointer specific to email routing and with a caveat. The MX record points to an A-Record instead of an IP address. The A-Record then points to the IP address. The MX record simply signifies which A-Record is to be used for Email traffic, and the associated A-Record points to the IP address of your Mail Server or Spam Filter.

MX record DNS example

As you can see, we have an MX record for dnsexample.com. Whenever an email would be sent to username@dnsexample.com, the MX record would be queried for dnsexample.com. As you can also see from above, the MX record will then point them to mail.dnsexample.com as the “pointer” for email. We also see an A-Record for mail.dnsexample.com that points to our mail server. This is how the MX Record helps to route email for a domain.

You may also wonder what the (10) in parenthesis means.

It’s a fair question. Each MX Record asks you to set a priority. In actuality, this is called many things such as preference, priority, or distance depending on the DNS Software you are using; but in reality, they all mean the exact same thing. The priority in essence tells a DNS query which record to try first. This only matters if you have more than one MX Record for a domain.  The LOWEST number is always tried first, and if the mail is unable to be delivered moves to the next lowest in priority.

Many are the ways in which MX Record Priority can be manipulated to help you accomplish your goals depending on your needs. You may set the same priority on multiple MX Records and utilize Round Robin in an attempt to load balance mail servers.  You can use a practice called “NoListing” to create MX Records that intentionally lead nowhere as your highest and lowest priority in order to cut down on spam, (spamming software will not typically try multiple MX Records and will instead try the first or last in the priority list).

In large environments, you may have “backup” servers that will queue messages for the primary server if the primary server is unable to receive the email, however if in a smaller environment, it usually makes more sense to simply load balance them to the same priority and let failover occur naturally. You can see examples of some of these tactics in practice below:

DNS example with multiple backups

This concludes part two of our look at Domain Name System records. I will be continuing this series with part three that covers PTR records (which are also email related). Find out more then, and as always thank you for reading!

2014-03-24T09:09:28+00:00 March 24th, 2014|

Leave A Comment