How to Set an MX Record to Receive Company Email
An MX record tells the world which servers accept mail for your domain. Learn how to add it correctly, avoid common mistakes and test that mail arrives.
10 min readUpdated Nov 21, 2026By XPASS Editorial Team

If you can send mail from your company address but nothing arrives, or if you have just bought a mail service and it says "waiting for DNS", the missing piece is usually the MX record. MX stands for mail exchanger. It is a single line in your domain's DNS that tells the rest of the internet where to deliver mail addressed to your domain. Get it right and mail flows; get it wrong and messages bounce, vanish into the wrong provider or arrive only some of the time.
This guide explains what an MX record is, how to find the right values, how to add them in a typical DNS panel and how to test the result. It also covers the mistakes that cause most problems: leftover old records, pointing at an IP address, mixing up priorities and forgetting that changes take time. If you are also moving from another provider, read the backup checklist before a server move first, because changing MX records redirects live mail.
What an MX record actually does
When someone sends a message to you@yourdomain.com, their mail server does not know where your mailboxes live. It asks DNS. Specifically, it requests the MX records for yourdomain.com. The answer is a short list of hostnames with a preference number, for example a primary server and a backup. The sending server connects to the most preferred host and hands the message over using the Simple Mail Transfer Protocol.
Three details are worth knowing.
- An MX record points to a hostname, not an IP address. The hostname then needs its own A (IPv4) or AAAA (IPv6) record so the sender can find the address. Your provider normally manages those; you only enter the hostname.
- Lower numbers mean higher preference. A record with priority 10 is tried before one with priority 20. If two have the same number, senders spread the load between them.
- The MX records are for incoming mail only. They have no effect on how your outgoing mail is judged. That is the job of SPF, DKIM and DMARC.
DNS itself is a distributed database defined in documents such as RFC 1035, where each record has a name, a type, a class, a time to live and data. An MX record's data consists of the preference number and the hostname.

Before you start: what you need
Collect these items before opening the DNS panel.
- The domain you will use, and confirmation that you control it.
- Access to the DNS zone, which is managed wherever the domain's name servers point. That may be the registrar, a hosting provider or a separate DNS service. If you are not sure, look up the name servers for the domain and see who runs them.
- The MX values from your mail provider. Providers publish a hostname and a priority for each required record, often one to five of them. Copy them exactly from the provider's setup page; do not guess or copy from another company's guide.
- A copy of your current DNS records, so you can restore anything you change by mistake. The backup guide covers how.
- A plan for old mail. If mail is currently delivered somewhere else, decide how you will collect what arrives there during the changeover.
If your plan billing period is still undecided, it does not affect the MX setup, but you may want to settle it before you start; annual versus monthly billing explains how to choose.
Step by step: add the MX records
The screens differ between DNS providers, but the steps are the same.
- Sign in to the DNS panel for the domain and open the list of records for the zone.
- Note the existing MX records. If there are any, copy them somewhere safe. They may belong to a previous provider.
- Add a new MX record. Fields are usually Name (or Host), Type, Value (or Mail server), Priority and TTL.
- Name: use the root of the domain, often shown as
@or left blank, so that the record applies to yourdomain.com itself. - Type: MX.
- Value: the hostname from your provider, for example
mail.example-provider.net. Some panels want a trailing dot and some do not; follow the panel's hint. - Priority: the number the provider specifies.
- TTL: leave the default or choose a short value, such as 300 to 3600 seconds, while you test.
- Name: use the root of the domain, often shown as
- Repeat for each additional record the provider requires, using its stated priorities.
- Remove or replace the old MX records. Leaving an old record in place means some senders will still deliver to the old server. Remove it only after you have recorded it and have a plan for the old mailboxes.
- Save the changes and wait for them to be published.
A plain example
Suppose the domain example-shop.com is moving to a new provider that asks for two MX records. The provider's setup page lists:
| Name | Type | Priority | Value |
|---|---|---|---|
| @ | MX | 10 | mx1.example-provider.net |
| @ | MX | 20 | mx2.example-provider.net |
In the DNS panel the owner adds both rows, deletes the old row that pointed to the previous host and saves. From then on, a sender looking up the MX records for example-shop.com receives two hostnames and tries mx1 first, falling back to mx2 if mx1 is unreachable. The values here are invented for illustration; always use the exact values given by your own provider.
Mistakes that cause most problems
- Pointing the MX at an IP address. It will not work as intended. Use the hostname your provider gives you.
- Pointing the MX at a CNAME. The standard expects MX targets to be real hostnames with address records, not aliases. Use what your provider specifies.
- Leaving the old records in place. A mix of old and new records splits incoming mail between two systems. Some messages will appear to be missing.
- Mixing priorities. If you copy a record from one guide and a priority from another, the order may not be what you intended. Use one consistent set from one source.
- Adding records on the wrong name. A record on
mail.yourdomain.comdoes not apply toyou@yourdomain.com. For ordinary addresses the MX belongs at the root of the domain. - Editing the wrong DNS zone. If your domain's name servers point to a hosting company but you edit records at the registrar, nothing changes. Check which name servers are authoritative.
- Forgetting the web and other records. When you replace the whole zone with a template, you might delete the A record for your website. Change only what you need.
- Testing too soon. A change can take time to reach every sender. Check again after the previous TTL has passed.
Testing the result
You can verify without special tools. Pick whichever of these is available.
- A command-line lookup. On macOS or Linux,
dig MX yourdomain.com +shortlists the records. On Windows,nslookup -type=MX yourdomain.comdoes the same. The output should show your provider's hostnames and priorities. - An online MX lookup tool. Many DNS and mail diagnostic sites show the records and whether the hostnames resolve.
- A real message from outside. Send a test email to your new address from a personal account at another provider. Send another from a different network if possible.
- A reply test. Reply from the new mailbox to confirm that sending works. Remember that this tests sending, which relies on different records from the MX.
- The provider's own verification. Most mail services have a button that checks your MX records and tells you whether they match.
Note the date and the exact result so that if something fails later, you can compare it with what was working.
Timing and the changeover period
DNS answers are cached. Each record has a time to live, and resolvers keep an answer until that time has passed. If the old MX records had a long TTL, some senders will continue using them after you save the new ones.
A calm way to handle this is:
- A day or two before the change, lower the TTL of the existing MX records if your DNS panel allows it.
- Make the change outside business hours.
- Keep the old mailboxes reachable for at least a few days and check them for stragglers.
- After the previous TTL has passed and test messages arrive consistently, raise the TTL again to a normal value.
- Retire the old service only after the new one is confirmed.
Mail transfer between servers also includes retrying. If a sending server cannot reach your domain's mail host, it generally queues the message and tries again for a period. That gives you some buffer, but the length of the period is decided by the sender, so do not rely on it for a long outage.
Limits and what to watch for
- MX is not authentication. It does not stop spoofing. For that you need SPF, DKIM and DMARC, which are separate DNS records.
- Not every provider uses the same number of records. Some give one, some several. Always follow your provider's instructions.
- Some DNS panels hide or auto-manage records. If your domain was bought together with a hosting or website builder service, an automatic mail setting might already exist. Check before you add your own.
- Changing MX moves new mail only. It does not copy existing messages. Older mail stays on the old server until you migrate it.
- Subdomains are independent. An MX record at the root does not cover
mail.yourdomain.comor other subdomains. Add records for subdomains only if you actually use addresses on them. - Permissions and ownership. Only change DNS for a domain you control. If a third party manages your DNS, ask them to apply the values and send you a confirmation.
- Client setup is a separate step. After mail arrives, you still need to connect your apps. For example, setting up Business Email in Outlook explains how to add the account on a desktop.
A short checklist
- Domain and DNS access confirmed.
- Existing records copied and saved.
- Provider's MX hostnames and priorities copied exactly.
- Old MX records recorded and then removed or replaced.
- Records saved at the root of the domain, pointing at hostnames.
- Test email received from an outside account.
- Old mailboxes monitored for a few days.
- TTL returned to a normal value.
- SPF, DKIM and DMARC checked as a separate task.
Troubleshooting when mail does not arrive
If a test message does not arrive, work through the checks in order rather than changing things at random.
- Look up the MX records again. Confirm that the lookup returns exactly the hostnames you entered and no leftovers. If it shows old values, the change has not been published or is still cached.
- Check the name servers. Make sure the zone you edited is the one the domain actually uses. If the name servers point elsewhere, your edits have no effect.
- Check for typos. A missing letter in a hostname is enough to break delivery. Compare against the provider's page character by character.
- Read the bounce message. If the sender received an error, it usually says whether the domain was not found, the host was unreachable or the mailbox does not exist. Each points to a different fix: DNS, provider-side setup or the mailbox itself.
- Confirm the mailbox exists. The best MX record cannot deliver to an address that has not been created on the provider's side. Check the spelling of the address as well.
- Check spam and quarantine folders. Mail may have arrived but been filtered.
- Wait for the old TTL. If you changed the record very recently, give caches time to expire before concluding something is wrong.
- Ask the provider. If everything above is correct, send the provider your lookup output and the bounce message. That gives support the information they need quickly.
Keep a simple log of each change you make, with the time and the result. When two people edit DNS during a migration, a short log prevents them from undoing each other's work.
Summary
An MX record is the entry in your DNS that tells other servers where to deliver mail for your domain. Take the exact hostnames and priorities from your provider, add them at the root of the domain, remove or replace the old records, and test with a message from an outside account. Expect some delay because of caching, keep the old mailboxes available during the changeover and treat SPF, DKIM and DMARC as a separate job. With those steps, the change is routine rather than risky.
When you are ready to set up mailboxes that your MX records will point to, the Business Email page describes what is available.
Frequently asked questions
What does an MX record do?
It tells other mail servers which hosts accept email for your domain and in what order to try them. When someone writes to you@yourdomain, their server looks up the MX records for yourdomain and delivers the message to the host listed there.
Can an MX record point to an IP address?
No. An MX record must point to a hostname, and that hostname must itself resolve to an address through an A or AAAA record. The hostname should not be an alias created with a CNAME.
What does the priority number mean?
It is a preference value. Senders try the record with the lowest number first and fall back to higher numbers if the first one cannot be reached. Use the values your mail provider gives you.
How long does an MX change take to work?
It depends on the TTL of the old records and on caching by resolvers. Some senders see the change within minutes and others within hours. Keep the old mailboxes available during the changeover.
Do I need SPF, DKIM and DMARC as well?
They are separate records. MX controls where incoming mail goes. SPF, DKIM and DMARC help receivers judge the mail you send. You should set both, but changing one does not change the other.
References
About the author

Bob Kanokphon Thongdee
- Founder of XPASS VPN
- Co-founder of eSIMonline.asia
- More than 7 years in online marketing
- Founder of Cojourney Visa and Cojourney Travel
Want email on your own domain?
Business email with your domain name, priced per mailbox.
See business emailKeep reading

Business Email Guides
Is Annual Business Email Better Than Monthly?
Annual billing is not automatically better value, and monthly is not automatically safer. Compare cash flow, flexibility and renewal risk with a simple worksheet.
9 min read

Business Email Guides
How to Set Up Business Email in Outlook
Add your company mailbox to Outlook on Windows or Mac with IMAP, the right server settings and encryption, then fix the usual sign-in and sync problems.
9 min read

Business Email Guides
How to Back Up Business Email Before Moving Servers
Moving a mail server is the moment mail gets lost. Use this checklist to back up mailboxes, contacts, rules and DNS records, and to prove the copy is complete.
10 min read