📧
How-To Guides

How to Set Up MX Records for Email

📅 Mar 10, 20267 min read✍️ Hostao LLC

If you want to receive email at your custom domain (you@yourdomain.com), you need MX records. These DNS records tell the internet which mail servers handle email for your domain.

What Are MX Records?

MX stands for Mail Exchanger. An MX record specifies the mail server responsible for accepting email on behalf of a domain, along with a priority value that determines the order in which servers are tried.

example.com.  MX  10  mail1.example.com.
example.com.  MX  20  mail2.example.com.

The lower the priority number, the higher the preference. In this example, mail1 is tried first. If it's unavailable, mail2 is used as a fallback.

Setting Up MX Records for Google Workspace (Gmail)

Google Workspace requires five MX records:

Priority  Mail Server
1         ASPMX.L.GOOGLE.COM.
5         ALT1.ASPMX.L.GOOGLE.COM.
5         ALT2.ASPMX.L.GOOGLE.COM.
10        ALT3.ASPMX.L.GOOGLE.COM.
10        ALT4.ASPMX.L.GOOGLE.COM.

Setting Up MX Records for Microsoft 365 (Outlook)

Microsoft 365 typically uses a single MX record:

Priority  Mail Server
0         yourdomain-com.mail.protection.outlook.com.

Replace "yourdomain-com" with your actual domain, using hyphens instead of dots.

Setting Up MX Records for Zoho Mail

Priority  Mail Server
10        mx.zoho.com.
20        mx2.zoho.com.
50        mx3.zoho.com.

Step-by-Step Setup Process

  1. Log in to your DNS provider — Go to the DNS management panel for your domain.
  2. Delete existing MX records — Remove any old MX records to avoid conflicts.
  3. Add new MX records — Enter each record with the correct priority and mail server address.
  4. Set the host/name field — Use @ or leave it blank to apply to your root domain.
  5. Save and wait — MX record changes can take up to 48 hours to propagate, though they often work within an hour.

Important Tips

  • MX records must point to hostnames, not IPs — Unlike A records, MX records reference domain names.
  • Don't point MX records to CNAMEs — The target of an MX record should have an A record, not a CNAME. This is required by the RFC specification.
  • Add SPF, DKIM, and DMARC records too — These TXT records are essential for email deliverability and security.
  • Test your configuration — Send a test email from an external account to verify everything works.

Troubleshooting

If email isn't working after setting up MX records:

  • Verify propagation has completed using dig MX yourdomain.com
  • Check for typos in the mail server hostnames
  • Ensure you didn't accidentally leave old MX records in place
  • Confirm your email provider account is fully set up and verified

Getting MX records right is essential for professional email. Take your time, double-check the values, and test thoroughly.

Share this article

Related Posts