MX Records Explained

What are MX Records?

MX records are a type of DNS record which tells the world what servers process email for your domain name. They are mandatory if you wish to recieve email, and can be very important when sending email.

Your email provider or web host should provide you with a set of MX records to use. Their control panel will likely configure them if you are using their nameservers / DNS servers. If in doubt, ask them what is correct. Don't guess, errors will impact incoming email.

What do they look like?

... At Google Domains

Acutal MX records for G Suite Email, in the Google Domains DNS editor.

... In cPanel

Example MX records, in the cPanel Zone Editor

...At CloudFlare

Actual MX records for G Suite Email, in the CloudFlare DNS editor.
CloudFlare's form to add a new MX record. (Step 1)
CloudFlare's 'Click to Configure' screen when adding a new MX record. (Step 2)

Components of an MX record

  • Name will typically be blank, your domain name followed by a dot (ex: example.com.), or the @ symbol.
  • TTL is how long the records should be cached, typically in seconds. 86400 is one day, and is a good default. If you will be changing MX records soon, using a much shorter TTL of 3600, or one hour, is suggested.
  • Priority tells remote mail servers what order to use when there are multiple MX records for the same domain.
  • Destination/Server is the hostname of the server that accepts email for your domain. It must be a "real" hostname with its own A or CNAME record.

What else should you know

  • Having a single MX record is totally fine. You can have multiple MX records, but should only have one for each server that accepts email.
  • It's rare (and very advanced) to MX records from multiple service providers at the same time. Typically, you would want to use only a single set of MX records, either from your host, or email provider, but not both. If in doubt, remove all current MX records, then add the correct ones your provider has given you.
  • Servers with lower priority numbers are used before servers with higher prioirity numbers. If a sending server can't reach your lowest priority servers, it will retry the next higher priority server.
  • Multiple servers can have the same priority. This tells any server sending email to you to use any server with that priority.
  • Zero (0) is the lowest number you should use. Servers with this priority will be used first.
  • Priority numbers are used to sort the list of possible servers, so any combination can be used. All of these combinations are fine:
    0, 1, 2, 3
    1, 2, 3, 4, 5
    1, 2
    10, 20, 30, 100
    0
    10
    10, 100
  • The MX records don't have to appear "in order" on your screen. The remote server will use the priority numbers to sort the list of servers.
  • SPF Records are used for sending email and inform remote mail servers what servers are allowed to send email for your domain.
  • DKIM Records are used for sending email and allow messages to be cryptographically signed by the sending mail server, so remote servers know the message originated from an authorized mail server.
  • DMARC Records allow you to specify how a recieving mail server should handle junk email that appears to be sent from your domain. Also can enable reporting of junk email back to you. Requires SPF and DKIM records.

More Resources

  • MX Toolbox - Provides many tools and monitoring services related to email and email deliverability.
  • IntoDNS - Checks the health and configuration for a domains DNS and email.
  • Your email provider or web host should be able to advise you how to configure your MX records, check for problems, and be generally helpful in this area.
Author image
Life time nerd with 15 years experience in coding, web development, and web hosting. These days I run an automotive business, but still help people learn to manage their own websites.
top