What is MX record (Mail Exchange)

In this blog you will learn what is MX record in DNS. We will discuss how MX record works, how to create an MX record, and how to check MX record.

Watch the video

Watch this video on our YouTube channel and learn what is an MX record and how MX record works.

What is MX record

An MX record (Mail Exchange record) is used to specify the email server responsible for receiving the email messages on behalf of a domain. It points to the address of the mail server where emails should be delivered. MX records play a crucial role in ensuring that emails are routed correctly across the internet.

The MX record is like an address book for emails. It tells email sending servers which server to use when delivering emails to a particular domain. It specifies the domain’s mail server and its priority. When someone sends an email, the MX record helps determine where to send it by listing the server’s name and a priority number.

The MX record contains two main pieces of information, the mail server’s hostname and its priority value. The hostname indicates the domain name of the email server, such as mail.example.com, and Priority value is represented as a numerical preference that allows for the designation of multiple mail servers. Lower values indicate higher priority, meaning that mail servers with lower priority values are attempted first for email delivery.

How MX record works

When a sender’s email server attempts to deliver an email, it starts with the mail server having the lowest priority (highest preference value) at the recipient side. If that server is unavailable or unreachable, it moves on to the next server with a higher priority until a successful delivery is made or all mail servers have been exhausted.

Let’s consider one example and things will be more clear. Let’s assume we have an organization with name ABC and it owns a domain abc.com. This organization has published all the required DNS records within their public DNS except MX record.

In this scenario, the email flow within abc.com organization (internal mail flow) will work. That means all the users of abc.com organization will be able to send emails to each other. However, abc.com domain will not be able to receive emails from an external domain, because abc.com organization hasn’t yet published MX record for their domain.

If an external organization will send email to abc.com domain users, that email will not be able to find a path to the recipient because when SMTP service will reach public DNS of abc.com domain, it will not find MX record and email will not be delivered to abc.com email server.

To overcome this situation, abc.com domain will have to publish an MX record in their public DNS, and all the external emails will be routed to their email servers.

Where should you point MX record

It depends on your business requirement from where you want your emails to be routed. We can point MX record either to Exchange Online Protection (EOP), or we can point it to a different email server.

If MX record is pointed to Office 365 and if an external domain will send an email to your tenant, that email will be delivered directly to Office 365, and will be filtered by Exchange Online Protection (EOP).

point mx record to office 365

However, this is not necessary to point MX record only to EOP. For example if you have your own email filtering solution like Sophos Central that provides protection for your emails, you can point MX record that email filtering server. And when an external domain will send an email, that email will be delivered to the email server first. The email filtering server will scan that email, and then email will be forwarded to Exchange Online Protection (EOP).

Important: We cannot disable Exchange Online Protection (EOP). Even if you are using a 3rd party email filtering server, when email will be redirected to Office 365, Exchange Online Protection will scan that email. And when EOP checks will pass, only then email will be delivered to the user’s mailbox.

MX record is also used for load balancing. Let’s assume we have an Office 365 tenant and we have 2 email servers which are responsible to filter the emails. We can publish multiple MX records for one domain, so that we can route our emails to multiple email servers. So this way the incoming emails will be equally distributed among all the email servers. If you have pointed MX record for your domain to Office 365, you will publish only one MX record. Because Office 365 doesn’t support multiple MX records.

MX record for Office 365

The value of MX record for Office 365 is domain-com.mail.protection.outlook.com. If your domain name is office365concepts.com, then MX record for Office 365 will be as below:

office365concepts-com.mail.protection.outlook.com

How to check MX record / MX record lookup

Once you have added MX record for your domain on the domain provider portal (public DNS), you can go to MXToolbox to verify the MX record.

how to check mx record

You can also perform NSLOOKUP to verify MX record for your domain. Open Command Prompt and type below commands one by one:

NSLOOKUP

Set q=MX

yourdomain.com
mx record lookup

Conclusion

In this blog you learnt what is MX record, how MX record works, how to check MX record, and what is the value of MX record for Office 365.

You might like other blog on SPF record.

If you found this article helpful and informative, please share it within your community and do not forget to share your feedback in the comments below. Please join us on our YouTube channel for the latest videos on Cloud technology and join our Newsletter for the early access of the blogs and updates.

FAQ

What is the purpose of MX record?

The MX record is like an address book for emails. It tells email senders which server to use when delivering emails to a particular domain. It specifies the domain’s mail server and its priority. When someone sends an email, the MX record helps determine where to send it by listing the server’s name and a priority number.

Is MX record required?

The MX record is important if you want to receive emails for your domain. It tells other mail servers where to send emails addressed to your domain. Without an MX record, you wouldn’t be able to receive any emails. It’s like having an address so that mail can be delivered to you. While it’s not mandatory, having an MX record is necessary for most people and organizations who use email.

What is an MX record?

MX DNS record is used to receive emails from external domains. With the help of MX DNS record we can control email flow. We can decide if we want to route emails to Office 365 or to a 3rd party email filtering server.

Are multiple MX records supported?

Office 365 doesn’t support multiple MX records. But if you are using a 3rd party email filtering server, you can create multiple MX records. By publishing multiple MX records we can route emails to multiple email servers equally.

Happy Learning!!