What Is MX Record & Why Is It Important for a Domain?
Preparing for a new email campaign and want to make sure your messages not only get sent to the right people but that you can receive responses as well?
You’ll have to check your mail exchange (MX) record before getting started.
It might surprise you, but there’s more to receiving emails than a server sorting through domain names.
What is an MX Record?
An MX record (or Mail Exchange record) is a part of the DNS (Domain Name System) zone file which specifies how emails should be routed for a particular domain.
Whenever an email is sent from one domain to another, the sending mail server will check the MX record of the recipient’s domain in order to determine at which mail server(s) the email message will be routed to.
In other words – without an MX record properly set up to direct incoming messages, you won’t receive emails.
How does MX record work?
Essentially, MX records tell the sender mail servers where (or how) they should deliver their emails to your domain.
MX records in the DNS consists of several parts:
- Domain – the name of the recipient’s email domain
- Mail server – recipient’s mail server that accepts incoming messages
- Priority value – a number that signifies the preferred mail server with which the sender MTA should try to establish an SMTP connection first (the lower the number, the higher the priority).
- TTL (Time To Live) – specifies how long should the DNS cache the MX record before refreshing its data.
So, for example, the MX record configuration can look like this:
Domain: www.warmupinbox.com Mail exchanger: emailhost1.www.warmupinbox.com Priority: 10 TTL: 300000 Domain: www.warmupinbox.com Mail exchanger: emailhost2.www.warmupinbox.com Priority: 20 TTL: 300000 |
With a configuration like this, all incoming emails will be directed to the server “emailhost1.www.warmupinbox.com” as it has a lower number in the “priority” value unless some unexpected technical failure occurs – in that case, the emails will be routed to the secondary “emailhost2.www.warmupinbox.com” backup mail server.
Your domain’s MX records are created and maintained through your DNS provider or choice.
How to configure an MX record?
Now that we have a basic understanding of MX record and how it works, let’s take a look at how to properly set it up.
Please, don’t be intimidated.
Coding email is just like coding a website or anything else. And as such, it’s important to ensure that you check off all the right boxes for a smooth setup.
Manually setting up your MX record can be done in a few steps:
1. Select the server for your MX record
Make sure to configure your MX record on the authoritative name server for your domain.
Generally speaking, the authoritative name server is the DNS server managed by the company you registered your domain to (a.k.a. by the registrar).
The domain registrars typically also provide additional services such as DNS hosting.
This will help you utilize a web-based DNS configuration and set up your MX record.
2. Set up your MX records
Configuring your DNS MX record is simply assigning priority to each server.
If you’re using Gmail, for example, you can setup your MX records by:
- Verifying your ownership of the domain (via a DNS record that Google will ask you to add).
- Adding the provided MX records to your DNS hosting provider.
There might be multiple MX records with various preference values depending on the structure of mail servers within your organization.
You can create a priority list for your MX record where the lowest preference has the highest priority.
Therefore, when a mail server will attempt to deliver you an email, it will send it to the highest priority MX record first.
Lower-priority MX records can point to another mail servers within your organization that have less bandwidth and serve as backup servers. The MX record can also link to third-party servers that support MX services.
The purpose of backup servers is to ensure that the email message is always delivered somewhere rather than causing it to bounce.
Note: Make sure to be extremely careful when configuring custom MX records (e.g. when you decide to direct all messages to a new email host) – if something goes wrong, you might stop receiving emails altogether. Before you begin configuring a custom MX record, it’s always a good idea to back up any important emails before you start the process. |
3. Check your MX configuration
After the MX record implementation, it might take a few hours until a new record will go into effect (depending on the speed of the system update, TTL set at the DNS record, etc.).
If you set up your MX record properly, you can use the “nslookup” command-line tool in order to check and see its configuration – if it displays the old MX record, you may need to wait a little longer until it gets updated.
However, using commands like this may not be easy, depending on your comfort level with coding.
Alternatively, you can also check your MX record with various online tools such as:
These applications can help you generate a comprehensive list of the MX records that are associated with a domain, identify deliverability problems, run diagnostics, or even check your domain against blocklists.
Since email deliverability hinges on MX records, it’s crucial to configure the records accurately, especially for businesses that send out mass email campaigns.
Optimum deliverability depends on a lot of factors, such as correct MX records, proper authentication records such as DKIM, SPF, and DMARC, as well as keeping your inbox warm.