What Is an MX Record and Why Does Business Email Need One?
An MX record points incoming email for your domain to the right mail servers. Here is how it works, how to set it up step by step, and what can go wrong.
10 min readUpdated Nov 19, 2026By XPASS Editorial Team

Every time someone sends an email to an address at your domain, their mail system has one question to answer first: where should this message go? The sender does not know your server, and your domain name is not an address. The answer comes from a DNS record called the MX record, short for Mail Exchanger. If the record is missing or wrong, email to your company can bounce, vanish or land with the wrong provider, even when your website works perfectly.
This article explains what an MX record is, how priorities work, how to set one up, and which mistakes cause the most lost mail. It is written for business owners and administrators who manage a domain but are not email specialists, and every step can be checked from a DNS control panel.
What an MX record is
DNS is the internet's address book. An A record answers "which IP address hosts this website?" An MX record answers a different question: "which servers accept email for this domain?" When you send a message to sales@example.com, your mail system takes the part after the @ sign, example.com, and asks DNS for its MX records. The reply is a list of hostnames, each with a priority number.
The email system itself is described in RFC 5321, the Simple Mail Transfer Protocol, which tells sending servers to look up MX records and to try the listed hosts in order. The record format belongs to the original DNS design in RFC 1035. If you want a plain overview of how these lookups fit together, the Cloudflare explanation of DNS is a gentle starting point.
Two points are worth fixing in your mind from the start.
- MX records are about receiving only. They tell the world where to deliver mail addressed to you. They do not control which servers may send mail on your behalf. That is the job of other records, such as the TXT records used for sender policies, discussed in the guide to TXT records and domain verification.
- MX records are independent of your website. Your website can be hosted with one company and your email with another. The A or CNAME record for
wwwand the MX records for the domain are separate entries that can point to completely different places.

How priority and fallback work
An MX record has two parts: a preference number and a hostname. A typical set looks like this:
| Name | Type | Priority | Target |
|---|---|---|---|
| example.com | MX | 10 | mail1.provider.example |
| example.com | MX | 20 | mail2.provider.example |
The sending server sorts the list by priority and tries the lowest number first. If that host does not respond, it moves to the next. The numbers themselves have no meaning beyond their order, so 10 and 20 behave exactly like 1 and 2.
Some providers publish several records with the same priority. In that case a sending server picks among them, which spreads incoming mail across several machines. This is a common arrangement for large providers and it needs no action from you beyond copying what they give you.
A fallback server is valuable because email systems are designed to be patient. If every MX host is unreachable, a sender usually keeps the message in its queue and retries for a period of time before giving up and returning a bounce. A good fallback means mail is accepted straight away instead of waiting in someone else's queue.
Why business email depends on it
A company address such as name@yourcompany.com looks more trustworthy to customers than a general mailbox, and it keeps your communication tied to a name you control. But the address only works if the MX records are right.
- Delivery. Without MX records, a sender may fall back to the domain's address record and try to deliver there. That is rarely what you want, and many systems simply refuse. In practice you should always publish explicit MX records for any domain that is meant to receive mail.
- Choice of provider. The MX records are how you tell the internet that your mail is handled by a particular hosted email service. Changing provider means changing these records.
- Reliability. Redundant MX entries keep mail flowing during short outages on one server.
- Not receiving mail on purpose. If a domain should never receive email, such as a domain you only use to show a website, it is good practice to say so clearly rather than leaving the situation ambiguous. A "null MX" published with a single dot as the target signals that no mail is accepted. Check your provider's guidance before using it.
If you want to see what a registrar or provider offers for managing records like these on your own name, the domains page lists the available options.
Setting up MX records step by step
- Choose your email provider first. Sign up with the company that will host your mailboxes. Their setup page will list the exact MX hostnames and priorities to publish. Copy these values exactly.
- Open the DNS settings for your domain. This is the control panel of whoever hosts your DNS: the registrar, a hosting company or a separate DNS service. Make sure you are editing the DNS that is actually in use, which is determined by the name servers set for the domain.
- Remove or replace old MX records. If the domain previously used another provider, delete the old entries or change them. Leaving old and new records mixed means some mail may still go to the old place.
- Add the new records. Create one record per line given by your provider. Set the type to MX, leave the name empty or
@for the root domain, enter the priority and enter the target hostname. Some panels require a trailing dot on the hostname, others add it for you. - Check the hostnames. The target must be a hostname such as
mail1.provider.example, not an IP address and not a URL. - Create the mailboxes at your provider. The records only route mail to the provider. The provider must also have a mailbox for each address.
- Add the supporting records. Your provider will usually also ask for TXT records for sender policies and signing. These do not replace MX records, but they are part of a complete setup. See the article on CNAME records and www for another common pair of records often added during the same visit.
- Test. Send a message from an outside address, such as a personal mailbox at another provider, and confirm that it arrives. Also send one the other way.
A worked example
Nina runs a small design studio with the domain ninadesign.example. Her website is hosted by one company and she has just chosen a hosted email service for her team.
She logs in to the DNS panel for her domain and finds a single MX record left over from an earlier trial pointing to a service she no longer uses. She deletes it and adds the two records her new provider shows: priority 10 to the first host and priority 20 to the second. She leaves her website's www and root address records untouched, because those are for the website, not for mail.
An hour later she sends a test message from a personal mailbox. It arrives in the new inbox. She then asks a colleague at a different company to send one, and that works too. Finally she checks that mail sent from the new mailbox is not marked as suspicious by recipients, and adds the TXT records her provider recommends for that purpose.
The stale record was the main risk: if she had simply added the new entries without removing the old one, roughly half of incoming mail could have gone to the abandoned service.
Common mistakes
- Pointing MX at an IP address. The standards require a hostname. Use the name your provider gives you.
- Pointing MX at a CNAME. The target of an MX record should be a name that resolves directly to address records. Aliases can work in some situations, but they are discouraged and can cause intermittent failures.
- Leaving old records in place. Mixed records send some mail to the wrong provider.
- Editing the wrong DNS. If your name servers are with one company and you edit the zone at another, nothing changes. Check which name servers the domain uses first.
- Forgetting the dot. In some systems a hostname without a trailing dot is treated as relative to your domain, producing a target like
mail1.provider.example.example.com. If a panel behaves this way, add the dot or follow its documented format. - Changing records before the mailboxes exist. Mail arriving at a new provider with no mailbox for that address will bounce.
- Typing a priority in the wrong field. Priority and hostname are separate fields.
Limits and what to watch for
Propagation and caching. Other mail systems cache your old MX records for as long as the TTL allows. After a change, some senders will keep using the old answer for a while. Keep the old mailbox active until you have confirmed that new mail is arriving, and consider lowering the TTL a day or two before a planned migration.
Moving mailboxes is a separate task. Changing MX records redirects new mail only. Existing messages stay where they are, so plan how to copy them if you need them in the new place.
MX does not prove who may send. A message can claim to come from your domain without passing through your mail servers. Sender-policy records protect against forged mail, but MX records do not.
Spam filtering is your provider's job. The record decides where mail goes, not whether it is wanted. Choose a provider with filtering suitable to your needs.
Subdomains need their own records. MX records on the root domain do not apply to team.example.com. If you want mail at a subdomain, publish records there as well.
Keep documentation. Write down the provider, the records, the date and who changed them. When something breaks six months later, this note saves hours.
A short checklist
- I know which provider hosts my mailboxes.
- I copied the MX hostnames and priorities exactly.
- I deleted old MX records from previous providers.
- Targets are hostnames, not IP addresses or aliases.
- I created the mailboxes at the provider before switching.
- I tested incoming mail from an outside address.
- I added the sender-policy TXT records my provider recommends.
- I know where my DNS is hosted and who can edit it.
If your site also uses IPv6, remember that the AAAA record is a website-address record and is separate from MX, although the mail servers named in your MX records can have both kinds of address.
Summary
An MX record tells the internet which servers accept email for your domain, and each entry carries a priority so that senders know which to try first. It needs a real hostname as its target, should replace the records of any previous provider, and works only for receiving mail, not for proving who may send. Set it up from your email provider's exact values, create the mailboxes, test from an outside address, and allow time for caching. Done carefully, it is a small change that keeps business email dependable.
When you are ready to manage records like these on your own name, you can look at what is available on the domains page.
Frequently asked questions
What does an MX record do?
An MX record names the mail servers that accept incoming email for your domain and gives each a priority number. A sending server looks up the MX records for the part after the @ sign and delivers the message to the best-ranked server that answers.
Can a domain have more than one MX record?
Yes. Most domains publish two or more. The server with the lowest priority number is tried first, and the others act as fallbacks if it is unreachable. Some providers publish several records with the same number so that mail is spread between them.
Can an MX record point to an IP address or a CNAME?
No. The target of an MX record must be a hostname that has its own address records. Pointing it at a raw IP address or at an alias is not allowed by the standards and often causes delivery problems.
How long does it take for MX changes to work?
It depends on the TTL of the old record and on caching by other mail systems. Many changes are visible within minutes to a few hours, but you should keep the old mailbox running until you have confirmed that new mail arrives at the new one.
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
Ready to register your domain?
Search a name, compare extensions and pay once for the years you choose.
.com registration from $18.81 for the first year
Search domainsKeep reading

Domain & DNS Guides
What Is a CNAME Record and How Do You Use It with www?
A CNAME turns one hostname into an alias for another. This guide shows how to use it for www, where it must not be used and how to test it.
10 min read

Domain & DNS Guides
What Is a TXT Record and Why Is It Used to Verify a Domain?
A TXT record stores a short piece of text in your DNS zone. Here is how it proves domain ownership, what else it carries, and how to manage it safely.
10 min read

Domain & DNS Guides
What Is an AAAA Record and How Does It Relate to IPv6?
The AAAA record is the IPv6 counterpart of the A record. This guide explains the format, when you need it, how to add it safely and how to test that IPv6 works.
10 min read