How To's
8 min read

Setting Up MX Records: A Practical Guide with Examples

MX records play a pivotal role in managing mail servers. Our guide offers a deep dive into DNS MX records, highlighting how they facilitate reliable mail delivery and tips for effective email server configuration
Written by
Harsh Patel
Published on
December 11, 2023

MX Record Explained

What is DNS MX Record for Email

A DNS MX Record, or Mail Exchange Record, is a type of record in the Domain Name System (DNS) that specifies a mail server responsible for accepting email messages on behalf of a recipient's domain.

A DNS MX Record tells the internet where to send emails for a specific domain. It points to the mail server that handles the domain's email.

Understanding Information Contained in DNS MX Record?

A DNS MX Record includes critical elements to manage and direct email delivery for a domain. It consists of:

MX Record Preference and Priority

These are numerical values that determine the order in which mail servers are approached for handling incoming emails. The lowest number indicates the highest priority.

MX Lookup

MX lookup is a tool or process for finding the MX record linked to a domain, essential for understanding email routing, diagnosing delivery issues, and confirming the responsible mail servers.

Integration with DNS and Simple Mail Transfer Protocol

MX Records function within the Domain Name System (DNS) as a resource record, which translates email domain names into IP addresses.

They work alongside the Simple Mail Transfer Protocol (SMTP) which is the standard protocol for sending emails across the internet, SMTP connection comes into play after DNS and MX (Mail Exchange) records, to ensure emails are correctly routed to and delivered at the recipient's mailbox.


Understanding How MX Record Works with the Help of an Example

How MX Record Works
Understanding How MX Record Works with the Help of an Example

Let's say example.com has these MX records in its DNS configuration:

  1. Primary MX Record - MX 10 primary-mail.example.com
  2. Secondary MX Record - MX 20 secondary-mail.example.com
  3. Tertiary MX Record - MX 30 backup-mail.example.com

MX Record Process:

  1. Initiates Email Delivery:
  2. When someone sends an email to user@example.com, the email system needs to know the destination mail server.
  3. Perform DNS MX Record Lookup:
  4. The sender's email service performs a DNS lookup for example.com.
  5. DNS & DNS Servers Analyze MX Records:
  6. DNS translates example.com to an IP address, enabling communication.
  7. DNS servers store these MX records, playing a pivotal role in guiding emails to the correct email servers.
  8. The DNS responds with example.com's MX records, indicating primary-mail.example.com, secondary-mail.example.com, and backup-mail.example.com as its mail servers.
  9. Prioritize with MX Records:
  10. The preference value (10, 20, 30) determines the order in which these servers are tried. Lower numbers mean higher priority and higher number means lower priority.
  11. Route Email to Mail Servers:
  12. The email is first directed to primary-mail.example.com (priority 10).
  13. If primary-mail.example.com is unavailable, it tries secondary-mail.example.com (priority 20), followed by backup-mail.example.com (priority 30).
  14. Backup MX Record Function:
  15. backup-mail.example.com serves as a standby. If the two servers are down, it ensures the email isn’t lost.
  16. Final Email Delivery:
  17. After MX records and DNS have guided the email to the right server, SMTP takes over.
  18. It ensures the email is sent from the sending server to the receiving server at example.com.
  19. Once the email reaches a responsive server, it's processed and delivered to user@example.com's inbox.
MX Record Workflow
MX Record Process:

This example illustrates the critical role of MX records in determining the path an email takes to reach its destination.

Why is MX Record Important For Your Email?

Think of an MX (Mail Exchange) Record as the postal address for your email.

Just like how a letter needs the correct address to reach your house, emails need the right MX Record to arrive at the correct email server.

MX Record is needed Because:

  1. MX Records Keep Your Emails on Track
  2. Directs Emails Correctly: An MX Record tells the internet where to send emails for your email domain, ensuring they land in the right inbox.
  3. Prevents Emails from Getting Lost: Without the correct MX Record, your emails might never reach their destination, just like a lost letter.
  4. Keep Your Mail Service Smooth
  5. Ensures Uninterrupted Email Flow: Regular checks of your MX Record keep your email flowing without any hiccups.
  6. Supports Load Balancing: Verified MX records allow for effective load balancing across multiple mail servers, preventing any single server overload.
  7. Safeguard Your Email Security
  8. Protects Against Wrong Routing: A correct MX Record prevents your incoming mail from accidentally ending up in the wrong hands.
  9. Helps with Safe Server Changes: When you update your email setup, verifying the MX Record makes sure everything transitions smoothly.
  10. Helps in Troubleshooting
  11. Makes Fixing Problems Easier: If there's an issue with email delivery, a verified MX Record helps quickly identify and solve the problem.
  12. Boost Your Email's Good Name
  13. Keeps Your Emails Out of Spam: Emails from domains with proper MX Records are less likely to be marked as spam, ensuring your messages are read.

How to Set up MX Records

Set up MS Records for Google Workspace on Different Hosting Services

To set MX Record for Google Workspace you need to search ' Google Workspace MS Record '

What you will have is a list of 5 MX Records values. Which you will need for the further steps.

MS Record Value of Google Workspace
Search for the MX Record

Understand the details you will enter for the new MX Record

  • Name: The hostname or prefix of the record, without the domain names. Enter @ to put the record on your root domain, or enter a prefix such as mail to deliver mails to an email addresses
  • Priority: The priority determines which record to contact first when multiple MX records exist on the domain. A lower number means more preferred, and the record with the lowest priority will be used first.
  • Value: The domain of the mail server
  • TTL (Time to Live): The amount of time the server should cache information before refreshing. The default setting is 1 hour

When Selecting the Domain Name

GoDaddy

  1. Log in to GoDaddy Domain Portfolio
  2. Go to Domain list and choose your domain
  3. Select DNS to view your DNS records
  4. Select Add New Record and then select MX from the Type menu
  5. Enter the details for your new MX record
  6. Select Add More Records to add multiple DNS records at the same time. If you change your mind, select
  7. Select Save to add your new record. If you added multiple records at the same time, select Save All Records
Add your MX Record

You should also create 4 more MX records with "@" in Name but different Mail Servers and Priorities:

ALT1.ASPMX.L.GOOGLE.COM priority = 5
ALT2.ASPMX.L.GOOGLE.COM priority = 5
ALT3.ASPMX.L.GOOGLE.COM priority = 10
ALT4.ASPMX.L.GOOGLE.COM priority = 10

Bluehost

  1. Log in to Bluehost
  2. Go to Domain list and choose your domain
  3. Select DNS to view your DNS records
  4. Select Add New Record and then select MX from the Type menu
  5. Enter the details for your new MX record
  6. Select Add More Records to add multiple DNS records at the same time. If you change your mind, select
  7. Select Save to add your new record. If you added multiple records at the same time, select Save All Records
Add your record in DNS Zone Editor

You should also create 4 more MX records with "@" in Name but different Mail Servers and Priorities:

ALT1.ASPMX.L.GOOGLE.COM priority = 5
ALT2.ASPMX.L.GOOGLE.COM priority = 5
ALT3.ASPMX.L.GOOGLE.COM priority = 10
ALT4.ASPMX.L.GOOGLE.COM priority = 10

Cloudflare

  1. Log in to Cloudflare
  2. Go to Domain list and choose your domain
  3. Select DNS to view your DNS records
  4. Select Add New Record and then select MX from the Type menu
  5. Enter the details for your new MX record
  6. Select Add More Records to add multiple DNS records at the same time. If you change your mind, select
  7. Select Save to add your new record. If you added multiple records at the same time, select Save All Records
Add the MX Record on CloudFlare

create 4 more MX records with "@" in Name but different Mail Servers and Priorities:

ALT1.ASPMX.L.GOOGLE.COM priority = 5
ALT2.ASPMX.L.GOOGLE.COM priority = 5
ALT3.ASPMX.L.GOOGLE.COM priority = 10
ALT4.ASPMX.L.GOOGLE.COM priority = 10

NameCheap

  1. Go to Advanced DNS settings
  2. Scroll to Mail Settings
  3. Choose "Gmail"
  4. Select Save to add your new record. If you added multiple records at the same time, select Save All Records
Setting up MX Record for Google WorkSpace on Name Cheap

Set up MS Records for Microsoft 365 on Different Hosting Services

To up MX Record for Microsoft 365 on different hosting services, you need to have your unique DNS value in Microsoft 365

To find the unique DNS Value in Microsoft 365

Find the TXT record value for verifying domain ownership

  1. Sign in to the Microsoft Online Portal
  2. Go to Domains.
  3. On the Domains page, click your domain.
  4. Choose Start setup. You go back to the Domains setup to see the specific value you must add.
  5. On the Add this TXT record page, you find step-by-step instructions to add a TXT record to verify your domain.

Note: If your DNS host does not let you add TXT records, you see MX record instead of TXT record.

  1. Copy the MS=msXXXXXXXX value (including the MS= part) shown on the page.
  2. Update your DNS records for step-by-step instructions to add the portal.
MX Record of Microsoft 365
Finding your MX Record for Outlook 365

You need custom DNS routing for your email, for example, to route traffic through an external spam filtering service

In the new MX record on your DNS host's site, ensure that the fields are set to precisely the following values:

  • Record Type: MX
  • Priority: Set the priority of the MX record to the highest value available, which is typically 0.
  • Host Name: @
  • Points to address: Paste the Points to address value that you copied from Office 365 here.
  • TTL: Set this value to 1 hour or to the equivalent in minutes (60), seconds (3600), so on

GoDaddy

  1. Go to your domains page at GoDaddy
  2. Under Domains, select the DNS.
  3. Under Records, select ADD.
  4. Choose MX option from the filter box
  5. Create MX record, add values as given above
Add your MX Record

Bluehost

  1. Go to your domains page at Bluehost
  2. Scroll to Mail Settings
  3. Under Domains, select the DNS.
  4. Under Records, select ADD.
  5. Choose MX option from the filter box
  6. Create MX record, add values as given above
Add MX record for Blue Host

Cloudflare

  1. Go to your domains page at Cloudflare
  2. Scroll to Mail Settings
  3. Under Domains, select the DNS.
  4. Under Records, select ADD.
  5. Choose MX option from the filter box
  6. Create MX record, add values as given above
Add your MX record

NameCheap

  1. Go to your domains page at NameCheap
  2. Scroll to Mail Settings
  3. Under Domains, select the DNS.
  4. Under Records, select ADD.
  5. Choose MX option from the filter box
  6. Create MX record, add values as given above
Use Custom MX and add your Outlook MX Record

Tools to Check MX Records

There are several tools available for checking MX records, each offering different features and levels of detail. Here are some commonly used tools:

  1. MXToolbox: A Web-based tool that allows users to easily check the MX records of a domain. It also provides additional diagnostic information about the mail server.
  2. DNSstuff: This is another web-based tool offering a suite of DNS and network diagnostic tools, including MX record lookup.
  3. Google Admin Toolbox: Google provides a toolbox for domain administrators, which includes an MX record-checking feature. It's particularly useful for those using Google Workspace services.
  4. Nslookup: A command-line tool available in most operating systems. It allows users to query DNS server for MX records and other DNS records.
  5. Dig (Domain Information Groper): Another command-line tool that is popular on Unix and Linux systems for querying DNS servers. It offers detailed information about MX records and other DNS entries.
  6. Windows PowerShell: For Windows users, PowerShell has cmdlets like Resolve-DnsName that can be used to query MX records.

Common MX Record Errors and How to Resolve Them

MX records, crucial for routing emails, can sometimes present challenges.

Some common errors exactly as they might be shown, along with their resolutions:

  1. "No MX Records Found" or "MX Records Not Set Up"
  2. Error Explanation: This error indicates that no MX records have been set up for the domain.
  3. Resolution: Create at least one MX record in the domain's DNS settings, pointing to a valid mail server.
  4. "MX Record Points to Non-Existent Server"
  5. Error Explanation: The MX records point to a mail server hostname that does not exist.
  6. Resolution: Update the MX record to point to an existing, operational mail server hostname.
  7. "Mail Server Unreachable"
  8. Error Explained: The specified mail server in the MX record is not responding.
  9. Solution: Implement multiple MX records for redundancy and rerouting. Check the mail server's status. If necessary, update the MX record to point to a different, operational mail server.
  10. "MX Record Points to CNAME"
  11. Error Explanation: MX records should not point to a CNAME (Canonical Name) record but directly to a hostname.
  12. Resolution: Change the MX record to point directly to a valid mail server hostname instead of a CNAME.
  13. "MX Records TTL Too Low"
  14. Error Explanation: The Time to Live (TTL) value for MX records is set too low.
  15. Resolution: Increase the TTL value for MX records. A higher TTL can improve email delivery efficiency.
  16. "Conflicting MX Records"
  17. Error Explanation: There are conflicting or duplicate MX record entries for the domain.
  18. Resolution: Review and remove any conflicting or duplicate MX records from the domain's DNS settings.
  19. "MX Records Violate SPF Policy"
  20. Error Explanation: The MX records are not aligned with the domain’s SPF (Sender Policy Framework) record.
  21. Resolution: Modify the SPF record to include the domain's mail servers listed in the MX records, ensuring alignment for email authentication.

FAQs

Can You Send Emails without MX Records? Myth vs. Reality

The Myth: It's possible to send and receive email without MX records

The Reality: Technically emails can be sent without MX records, this is not advisable in practice. Without MX records, the domain's mail server lacks proper directions, leading to email traffic being misrouted or lost. The system delivers messages by using the domain's A or AAAA record which leads to a significant risk of non-delivery or misrouting as these records are not designed to handle email traffic.

What is Backup MX Records & why do you need it

A backup MX record is an essential safety net for your email system. It specifies an alternative mail server to handle your emails in case the primary server fails. This redundancy ensures that emails continue to receive emails without interruption, even during downtimes or maintenance periods of your primary mail server. By having a backup MX record, you significantly reduce the risk of email loss or delay, maintaining reliable communication channels for your domain

What Happens If MX Record is Not Found

If a Mail Exchanger record is not found for a domain, emails sent to that domain will fail to be delivered. The sending party will usually receive the notification of delivery failure, indicating that the recipient's domain lacks the necessary MX record for email routing.

What Happens If You Setup MX Record Incorrectly

  1. Email Delivery Failures: Emails may not be delivered to the intended recipients, leading to communication gaps.
  2. Misrouted Emails: Emails might be sent to the wrong server, causing confidentiality breaches or data loss.
  3. Increased Spam Flagging: Incorrect MX records can lead to emails being marked as spam by the recipient server, affecting sender reputation.
  4. Delayed Email Receipt: Emails might face significant delays, impacting timely communication.

What is Alore?

Email Warmer

Generate real engagement to Warm Up Your Email Address without any human intervention

Drip Campaigner

Send emails that generate new business opprotunities for you

Collaborative Inbox

Improve team performance & customer experience - manage multiple email addresses from one place