Explore WaseerHost

Appearance

GuideDomainsDNS 12 min read

How to add MX records for business email

Add MX records in cPanel or at your registrar, with the exact values for Google Workspace and Microsoft 365, how priority works and how to test the result.

How to add MX records for business email

Summarize with:

Share:

This guide shows how to add MX records for business email in three places: the cPanel Zone Editor, a registrar's DNS page, and the setup screens for Google Workspace and Microsoft 365. The short version is to open the DNS zone for your domain, delete the MX records that point to your old mail provider, add the new record with the priority your provider gives you, and test it. The sections below give the exact values and the mistakes that stop mail from arriving.

Key takeaways

  • An MX record tells other mail servers which host accepts email for your domain. It holds a priority number and a hostname.
  • A lower priority number wins. Sending servers try priority 0 or 1 before 10, and 10 before 20.
  • Google Workspace uses one record, smtp.google.com at priority 1. Microsoft 365 gives each domain its own value, which you copy from the admin center.
  • Add the record where your nameservers point. A change made at the registrar does nothing if the DNS zone lives at your web host.
  • On cPanel, check Email Routing after you change the MX record, or the server may keep mail for itself.

What an MX record is

MX stands for mail exchanger. When someone sends a message to [email protected], their mail server asks DNS for the MX records of example.com and connects to the host named in the answer. Without that lookup the sender has no way to know whether Google, Microsoft or your own web host handles your mail.

Each MX record has two parts, defined in RFC 1035. The preference is a 16 bit number, so it can run from 0 to 65535. The exchange is the hostname of a server that accepts mail for the domain.

A typical record looks like this in a zone file:

text
example.com.    3600    IN    MX    10    mail.example.com.

Read it left to right as the domain, the TTL in seconds, the class, the record type, the priority and the mail server. If MX is new to you, the guide to what DNS records are covers the other record types you will see in the same zone.

How MX priority values work

DNS hosts call the number "priority" and the standards call it "preference". Both mean the same thing. RFC 5321 says "Lower numbers are more preferred than higher ones", so a sending server sorts your MX records and starts with the smallest number.

PriorityMail serverWhat a sending server does
10mx1.example.netTries this host first
20mx2.example.netTries this host if the first one fails
20mx3.example.netShares the second position with mx2

Only the order matters. Priorities 1 and 2 behave the same as 10 and 20. When two records share a number, RFC 5321 tells the sender to pick between them at random, which spreads the load across both servers.

Use the single record or the set your provider publishes, and nothing else. Microsoft's DNS records reference notes that multiple MX records can cause delivery problems and that one record pointing to one mail system removes many of them. If you leave your old provider's record in the zone as a backup, any mail that reaches it sits in a mailbox nobody reads.

Before you add the record

Three checks save most of the trouble.

  1. Find where your DNS zone lives. The zone sits with whoever runs your nameservers, which may be your registrar, your web host or a separate DNS service. A WHOIS lookup lists the nameservers for your domain, and the guide to what nameservers are explains how to read them.
  2. Create the mailboxes first. Microsoft's setup guide tells admins to add users before they update the MX record, so mail has somewhere to go the moment the change takes effect.
  3. Write down the current MX records. If something goes wrong you can put the old values back in a minute.

Changing the MX record moves new mail only. Microsoft states that existing email stays at your previous host unless you migrate it.

If you have not picked a provider yet, WaseerHost offers business email on your own domain. The steps below work the same way for any provider.

How to add MX records in cPanel

Use these steps when your domain uses your web host's nameservers. Every WaseerHost hosting plan uses cPanel, so the screens match. The labels below come from the cPanel Zone Editor documentation.

  1. Log in to cPanel and open Zone Editor in the Domains section.
  2. Find your domain in the list and click MX Record.
  3. Type the priority number in the Priority box.
  4. Type the mail server hostname in the Destination box. cPanel requires a fully qualified domain name here, such as smtp.google.com.
  5. Click Add An MX Record.

Remove the old MX records

  1. In Zone Editor, click Manage next to the domain.
  2. Use the record type filter to show only MX records.
  3. Click Delete next to each record that points to the old mail server, then click Continue to confirm.

You can also click Edit on an existing record, change the priority or destination, and click Save Record.

Set Email Routing

This step is specific to cPanel. Email Routing decides whether the cPanel server itself accepts mail for the domain.

  1. Open Email Routing in the Email section of cPanel.
  2. Select the domain.
  3. Choose Remote Mail Exchanger if Google, Microsoft or another outside service hosts your mailboxes. Choose Local Mail Exchanger if the mailboxes are on this cPanel server.
  4. Click Change.

With Local Mail Exchanger selected, the cPanel documentation says the server "will always accept mail for the domain" and deliver it to the local mailbox. A message that your website sends to an address at your own domain then goes to a mailbox on the server and never reaches your Google or Microsoft inbox.

Automatically Detect Configuration is the setting cPanel recommends, but it reads the zone file on the server and does not perform a real DNS lookup. If your DNS zone lives somewhere else, set the option by hand.

How to add MX records at a registrar or DNS host

Field names change from one company to the next, but the form asks for the same five things. Google's and Microsoft's setup pages use the labels below.

FieldOther namesWhat to enter
TypeRecord typeMX
HostName, Alias@ or blank for the main domain, or the subdomain label such as support
ValuePoints to, Answer, DestinationThe hostname from your email provider
PriorityPreferenceThe number from your email provider
TTLTime to liveThe default, unless your provider gives a value
  1. Sign in to the company that runs your nameservers.
  2. Open the DNS settings for the domain. Look for a page called DNS records, domain management or DNS manager.
  3. Delete the MX records that point to the old provider.
  4. Add a new record with the type set to MX and fill in the fields from the table.
  5. Save the record.

Some DNS hosts want a dot at the end of the hostname and others do not. Per RFC 1035, a name without the dot is relative, and the DNS server appends your domain to it. If a lookup later shows smtp.google.com.example.com, your DNS host treated the name as relative. Add the trailing dot or follow the format your DNS host documents.

Point your mail to Google Workspace

Google publishes one record for every customer. These values come from Google's MX setup page.

FieldValue
TypeMX
HostBlank or @
Priority1
Valuesmtp.google.com
TTLYour DNS host's default
  1. Verify your domain in Google Workspace if you have not done so.
  2. Remove every other MX record. Google warns that email "might not work correctly if you keep old or incorrect MX records".
  3. Add the record from the table and save it.
  4. In the Google Admin console, go to Account, then Domains, then Manage domains, and click Activate Gmail for the domain.

Accounts that started before 2023 may have records that start with aspmx. Google says those legacy values are still supported and you do not need to change them if your email works. The full walkthrough for a new account is in the guide to using Gmail with your own domain.

Point your mail to Microsoft 365

Microsoft gives each domain its own MX hostname, so you cannot copy the value from another company. It follows the pattern <MX token>.mail.protection.outlook.com, and Microsoft's guide to adding DNS records at any DNS host tells you to copy yours from the admin center.

  1. Sign in to the Microsoft 365 admin center.
  2. Select Show all, then Settings, then Domains.
  3. Select your domain, then DNS records, then Manage DNS.
  4. Select Continue and make sure Exchange and Exchange Online Protection is selected.
  5. Expand MX Records and copy the value shown.
  6. Add the record at your DNS host with the values in the table below.
  7. Return to the admin center and select Continue so Microsoft can verify the record.
FieldValue
TypeMX
Host@
Points toThe value you copied from the admin center
Priority0, or the highest priority your DNS host allows
TTL3600

Microsoft offers two choices for an MX record left by your previous provider. Remove it, or give it a larger priority number than the Microsoft 365 record. Microsoft's DNS records reference says to remove the old records once email flows to Exchange Online. Exchange Online also supports only TTL values under 6 hours, which is 21,600 seconds.

Test your MX records

Check the public answer and do not rely on what the DNS editor shows. Google says new MX records can take up to 72 hours to be recognized.

On macOS or Linux, run dig:

bash
dig example.com MX +short

On Windows, use Command Prompt:

cmd
nslookup -type=MX example.com

Or PowerShell:

powershell
Resolve-DnsName -Name example.com -Type MX

A domain on Google Workspace should return one line:

text
1 smtp.google.com.

If you prefer a browser, the WaseerHost DNS lookup tool shows the MX records for any domain, and Google's Admin Toolbox Dig does the same. Once the answer is correct, send a message to your new address from an outside account and reply to it.

Common mistakes with MX records

  • You left the old records in place. Senders may still deliver to the old server, so some mail reaches the new inbox and some does not.
  • You pointed the record at an IP address. RFC 5321 requires a domain name in the record. Create an A record for a name such as mail.example.com and point the MX record at that name.
  • You pointed the record at a CNAME. RFC 2181 says the name in an MX record "must not be an alias" and must have address records of its own.
  • You reversed the priorities. The smallest number is the first choice, so the main server needs the smallest number.
  • You edited the wrong zone. If the nameservers point to your web host, records added at the registrar have no effect.
  • You forgot the sending side. MX records only control incoming mail. Add the SPF and DKIM records your provider lists so receiving servers can check the mail you send.

For Microsoft 365 the SPF value is v=spf1 include:spf.protection.outlook.com -all. If the domain already has an SPF record, Microsoft says to merge the new value into it so the domain keeps a single SPF record. The guide to SPF, DKIM and DMARC setup explains how to build and check all three records.

Frequently asked questions

Sign in to the company that runs your nameservers and open the DNS zone for the domain. Edit the existing MX record or delete it and add a new one with the hostname and priority from your new email provider. In cPanel you do this in Zone Editor under Manage, using the Edit and Save Record buttons.

Waqas Ahmed Waseer

Written by

Waqas Ahmed Waseer

Founder & CEO

Founder and CEO of Wasevo LLC, the company that runs WaseerHost. He works on cPanel/WHM servers, WHMCS billing and the Next.js storefront.

Related Guides

Get new guides by email

One short email when we publish something useful. No spam; unsubscribe at any time.

Free SSL · Free migration · 24/7 support

Find your domain

Search domains
30-day money-back guarantee

Renews at the same price for the term you choose