How to Configure MX Records

A
Admin·1 months ago
021014 minutes read
How to Configure MX Records

Quick answer: To configure MX records, log in to your DNS provider, add a TXT or MX record type pointing to your email provider's mail server hostname, set the priority value as specified by your provider, and wait for DNS propagation. Most email providers supply the exact record values in their setup documentation.


Why MX Records Are the First Place to Look When Email Stops Working

When email sent to a domain stops being delivered, the MX record is almost always the first place to look. An MX record is the DNS entry that tells the internet where to deliver email for your domain — without it, or with an incorrect value, messages sent to your domain have nowhere to go. This is also why MX records are the most time-sensitive part of any email migration or new domain setup: until the MX record is correctly configured and propagated, no inbound email will reach the intended mailboxes. This guide covers how to configure MX records for any email provider, what the priority value means and how to set it correctly, how to verify the configuration is working, and the most common mistakes that cause MX record setups to fail. The steps here apply to any DNS provider — the interface will differ, but the underlying record structure is standardized across all DNS systems.


What MX Records Are and How Email Routing Actually Works

What MX Records Are and How Email Routing Actually Works

DNS (Domain Name System) is the system that translates human-readable domain names into the technical addresses that computers use to communicate. Most people are familiar with A records, which map a domain to an IP address for web traffic. MX records serve a different purpose: they map a domain to the hostname of a mail server, telling the global email system where to deliver messages addressed to that domain. When someone sends an email to user@example.com, their mail server performs a DNS lookup for the MX records of example.com. The response includes one or more mail server hostnames and their associated priority values. The sending server then attempts to connect to the highest-priority mail server (the one with the lowest priority number) and deliver the message. If that server is unavailable, it tries the next one in order. This process happens automatically and takes milliseconds under normal conditions. MX records point to hostnames, not IP addresses — this is an important distinction. The hostname in an MX record (such as aspmx.l.google.com for Google Workspace) must itself resolve to an IP address via a separate A or AAAA record. This means you should never put an IP address directly in an MX record value, and you should never point an MX record at a CNAME — both are common configuration errors that can cause intermittent or complete email delivery failures.

DNS RecordPurposeRequired ForMXDirects inbound email to the correct mail serverReceiving email at your domainSPFAuthorizes which servers can send email on behalf of your domainOutbound email authenticationDKIMAdds a cryptographic signature to verify message integrityOutbound email authenticationDMARCApplies a policy when SPF or DKIM fails; sends reports to domain ownerEmail authentication enforcementA / AAAAResolves mail server hostnames to IP addressesRequired by MX — managed by your email provider

MX records handle inbound routing; SPF, DKIM, and DMARC handle outbound authentication. All four are needed for reliable, secure business email.


5 Things to Understand Before Configuring MX Records

1. MX Record Structure — Hostname, Priority, and TTL

Every MX record has three key components: the hostname of the mail server, the priority value, and the TTL (Time to Live). The hostname is the address of the mail server that will receive email for your domain — your email provider's documentation will specify the exact value to use. For Google Workspace, the primary MX record hostname is aspmx.l.google.com; for Microsoft 365, it follows the format yourdomain-com.mail.protection.outlook.com. The priority is a number that determines the order in which mail servers are tried — lower numbers are tried first. The TTL controls how long DNS resolvers cache the record before checking for updates; a lower TTL means changes propagate faster but generates more DNS queries. A typical Google Workspace MX record set looks like this:

HostnamePriorityTypeaspmx.l.google.com1MXalt1.aspmx.l.google.com5MXalt2.aspmx.l.google.com5MXalt3.aspmx.l.google.com10MXalt4.aspmx.l.google.com10MX

Always use the exact values from your email provider's current setup documentation, as these may change over time.

2. Priority Values — Lower Number Means Higher Priority

The priority value in an MX record is one of the most commonly misunderstood aspects of DNS email configuration. A lower number means higher priority — so a server with priority 1 will always be tried before a server with priority 10. This is counterintuitive for anyone who thinks of higher numbers as meaning "more important." The practical implication: if you are setting up a primary mail server and a backup, the primary should have the lower priority number. If two records have the same priority number, sending servers will choose between them randomly, which is useful for load-balancing across equivalent servers. Many email providers specify exact priority values in their setup documentation — use those values rather than choosing your own. Incorrect priority values won't necessarily prevent email delivery, but they can cause messages to be routed to a backup server first, which may result in slower delivery or unexpected behavior if the backup server is not fully configured.

3. Where to Make the Change — DNS Provider vs. Domain Registrar

MX records are managed wherever your domain's DNS is hosted — which may or may not be the same place where you registered the domain. Many organizations register domains through one provider (such as GoDaddy or Namecheap) but manage DNS through a separate service (such as Cloudflare or AWS Route 53). To find out where your DNS is managed, look up your domain's nameservers using a tool like MXToolbox or your registrar's control panel. The nameservers tell you which provider is authoritative for your DNS — that is where you need to log in to add or modify MX records. If your DNS is managed by Cloudflare, for example, you would log in to the Cloudflare dashboard, select your domain, navigate to the DNS tab, and add the MX records there — not in your domain registrar's control panel. Making changes in the wrong place is a common source of confusion when MX record updates don't seem to take effect.

4. TTL and Propagation — Planning Around the Delay

4. TTL and Propagation — Planning Around the Delay

DNS changes do not take effect instantly. When you update an MX record, the change must propagate across DNS resolvers worldwide, and the speed of propagation depends on the TTL value of the existing record. If the current TTL is set to 86400 seconds (24 hours), resolvers that have recently cached the old record may continue using it for up to 24 hours after you make the change. If possible, reduce the TTL before planned DNS changes to speed up propagation — a value around 300 seconds (5 minutes) is commonly used, though not all DNS providers support very low TTL values. After the change is confirmed and stable, the TTL can be raised back to a standard value. During the propagation window, some sending servers may still deliver to the old mail server while others route to the new one. This is expected behavior and is why keeping the old mail server active during a transition period is important — messages delivered to the old server during propagation should be forwarded or manually transferred to the new one.

5. Common MX Record Mistakes That Break Email Delivery

⚠️ Worth knowing before you proceed: Several common configuration errors can cause MX records to fail silently — meaning email appears to be configured correctly but messages are not delivered. The most frequent mistakes are: pointing the MX record to an IP address instead of a hostname (MX records must point to hostnames); pointing the MX record to a CNAME record (this is explicitly prohibited by RFC 2181 and causes unpredictable behavior); leaving the old MX records in place alongside the new ones with conflicting priority values; and adding the MX record to a subdomain instead of the root domain when the intent is to receive email at the root domain. After making any MX record change, verify the configuration using MXToolbox's MX lookup before considering the setup complete.


How to Configure MX Records — Step by Step

How to Configure MX Records — Step by Step

Step 1: Gathering the Required Values from Your Email Provider

Before logging in to your DNS provider, collect the exact MX record values from your email provider's setup documentation. Every provider specifies the mail server hostnames and priority values that must be used — these are not interchangeable between providers. For Google Workspace, the setup documentation is available at support.google.com/a/answer/140034. For Microsoft 365, the values are generated specifically for your domain and are displayed in the Microsoft 365 Admin Center under Domains → DNS records. For other providers, look for "MX record" or "DNS setup" in the provider's help documentation. Copy the values exactly — a single character error in a mail server hostname will cause delivery failures.

Step 2: Lowering the TTL Before Making Changes

If you are replacing existing MX records (rather than adding them for the first time), consider lowering the TTL on the existing MX records before making the actual change. If your DNS provider supports it, a value around 300 seconds (5 minutes) can significantly reduce the propagation window. This step is optional if you are setting up MX records for the first time on a new domain, but it is worth doing for any domain that is currently receiving email. A lower TTL means that once you make the change, it will propagate to many DNS resolvers more quickly, reducing the window during which some messages may be routed to the old server.

Step 3: Adding the New MX Records

Log in to your DNS provider's control panel and navigate to the DNS management section for your domain. Add each MX record specified by your email provider. For each record, you will typically need to enter: the record type (MX), the host or name field (usually @ or left blank to indicate the root domain), the mail server hostname (the value from your provider's documentation), and the priority value. If your DNS provider combines the priority and hostname into a single field, enter them in the format 10 aspmx.l.google.com (priority first, then a space, then the hostname). Add all records specified by your provider before proceeding — some providers require multiple MX records for redundancy.

Step 4: Removing Old MX Records

After adding the new MX records, delete any old MX records that point to the previous mail server. Leaving old records in place alongside new ones can cause messages to be routed to the wrong server, particularly if the old records have a lower priority number than the new ones. The exception is during a planned migration where you intentionally want to keep the old server active as a fallback during the propagation window — in that case, set the old records to a higher priority number than the new ones so that the new server is tried first. Once propagation is confirmed and the new server is receiving mail correctly, remove the old records.

Step 5: Verifying the Configuration

After making the changes, use MXToolbox's MX lookup tool (mxtoolbox.com/MXLookup.aspx) to verify that the new records are resolving correctly. Enter your domain name and check that the results show the expected mail server hostnames and priority values. Note that the tool may still show old records during the propagation window — if the records look correct in your DNS provider's control panel but MXToolbox still shows old values, wait 15–30 minutes and check again. Once the new records are visible in MXToolbox, send a test message to an address at your domain from an external account (such as a personal Gmail or Outlook account) and confirm it is delivered to the new mail server.


Frequently Asked Questions — MX Records and DNS Email Setup

Frequently Asked Questions — MX Records and DNS Email Setup

What is an MX record and what does it do?

An MX (Mail Exchanger) record is a DNS record that specifies which mail server is responsible for receiving email on behalf of a domain. When someone sends an email to an address at your domain, the sending mail server looks up your domain's MX records to find out where to deliver the message. Without a correctly configured MX record, email sent to your domain will not be delivered. MX records are separate from A records and CNAME records and must be configured specifically for email routing.

What does the priority number in an MX record mean?

The priority number tells sending mail servers which mail server to try first. Lower numbers indicate higher priority — a server with priority 1 will be tried before a server with priority 10. If the highest-priority server is unavailable, the sending server will try the next one in order. Many email providers specify the exact priority values to use in their setup documentation; using those values rather than choosing your own is generally the safest approach.

How long does it take for MX record changes to take effect?

MX record changes typically propagate within a few minutes to 48 hours, depending on the TTL value set on the record and how recently DNS resolvers have cached the previous value. Lowering the TTL to 300 seconds at least 24 hours before making the change significantly reduces the propagation window. During propagation, some sending servers may still deliver to the old mail server — keeping the old server active during this period helps avoid message loss.

Can I have multiple MX records for the same domain?

Yes, and it is generally recommended. Multiple MX records provide redundancy — if the primary mail server is unavailable, sending servers will attempt delivery to the next server in the priority order. Some email providers, including Google Workspace and Microsoft 365, require multiple MX records as part of their standard configuration. Each record should point to a different mail server hostname, with priority values that reflect the intended delivery order.

Do I need to pay extra to configure MX records?

Configuring MX records is generally included in standard DNS management, which is provided by your domain registrar or DNS hosting provider at no additional cost. The MX records themselves are free to create and modify. The cost associated with email routing comes from the email service you are routing to — such as Google Workspace or Microsoft 365 — not from the DNS record itself. Some registrars charge for advanced DNS features; check your registrar's current plan details to confirm what is included.


Conclusion & My Take

Configuring MX records is one of the more straightforward DNS tasks, but it is also one where small errors have significant consequences — a single typo in a mail server hostname, or leaving an old record in place with a conflicting priority, can silently break inbound email delivery for hours or days. The most reliable approach is to collect the exact values from your provider's documentation before touching anything, lower the TTL in advance if you are replacing existing records, and verify the result with an external lookup tool before considering the setup complete. If you are setting up MX records for the first time on a new domain, the process is typically straightforward: add the records your provider specifies, wait for propagation, and verify with a test message. If you are replacing existing records as part of a migration, the TTL management and parallel-run period are worth the extra planning time — they significantly reduce the risk of message loss during the transition. Either way, the verification step is not optional: confirming that the records resolve correctly and that test messages are delivered is the only reliable way to know the configuration is working. Have you recently configured MX records for a domain migration or a new email setup? I would be curious to hear which DNS provider you used and whether the propagation was faster or slower than expected — feel free to share in the comments below.


Sources

Share

Related Posts