If you have ever sent an email to someone@yourbrand.com and wondered how the message finds its way to the right inbox, the answer is DNS. Specifically, the MX record. Without it, email sent to your domain has nowhere to go. Messages bounce back to the sender with a delivery failure error, even if your website loads perfectly fine.
What is an MX record?
MX stands for mail exchange. An MX record is a DNS record type that tells sending mail servers which server is responsible for receiving email on behalf of your domain. When someone sends a message to hello@yourbrand.com, their mail server looks up the MX record for yourbrand.com and delivers the message to the server listed there.
Unlike an A record, which stores an IP address directly, an MX record stores a hostname (like mail.yourbrand.com). That hostname then resolves through its own A record to an IP address. This two-step lookup gives email providers flexibility to change server addresses without updating every customer's MX record.
How does an MX record work?
The delivery process follows a clear sequence.
- A sender composes an email to an address at your domain and their mail server accepts it for delivery.
- The sending server queries DNS for the MX record of your domain.
- DNS returns one or more MX records, each with a priority value and a hostname.
- The sending server connects to the hostname with the lowest priority number (highest priority).
- If that server is unreachable, the sender tries the next MX record in priority order.
- Once connected, the receiving server accepts the message and places it in the correct mailbox.
This process runs automatically for every email sent to your domain. You configure the MX record once in your DNS panel, and every mail server worldwide uses it to route messages correctly.
What is MX priority?
Each MX record includes a priority value, a number that determines which mail server receives email first. Lower numbers mean higher priority.
If your domain has two MX records, one with priority 10 and one with priority 20, sending servers always try the priority 10 server first. The priority 20 server acts as a backup. If the primary server is down or unreachable, mail flows to the backup automatically.
Most small brands need only one MX record. Multiple records with different priorities are common for larger organizations that want redundancy. Your email provider tells you exactly which MX records and priority values to use.
How is an MX record different from an A record?
Both are DNS records, but they serve different purposes and store different values.
- A record: Maps a domain to an IP address for website traffic
- MX record: Maps a domain to a mail server hostname for email delivery
Changing your A record to point your website at a new host does not affect email, as long as you leave your MX records untouched. This is a common source of confusion during hosting migrations. People update their web records and accidentally delete or modify their MX records at the same time, breaking email delivery.
Always verify your MX records before and after any DNS change. If email stops working after a migration, the MX record is the first thing to check.
How to set up an MX record
Setting up an MX record follows the same process as any DNS change. Log in to wherever your DNS is managed, create a new record, select MX as the type, and enter the values your email provider gives you.
You typically need the mail server hostname and a priority number. Some providers give you multiple MX records for redundancy. Add each one exactly as specified. Do not guess hostnames or priority values.
If you are setting up email for the first time, the chapter on how to set up email on your domain covers the full process from choosing a provider to verifying delivery.
Common MX record mistakes
Deleting MX records during a web migration. When you update A records to point your website at a new host, your MX records must stay exactly as they were. Double-check them after every DNS change.
Using the wrong hostname. MX records point to a hostname, not an IP address. Entering an IP address directly in an MX record field will not work. Use the mail server hostname your email provider specifies.
Conflicting MX records. If old MX records from a previous email provider remain alongside new ones, mail may split between two systems. Remove old MX records completely before adding new ones.
Not lowering TTL before switching email providers. Just like A record changes, MX record updates depend on TTL for propagation speed. Lower TTL on your MX records a day or two before switching providers to minimize delivery gaps.
How WEMASY handles email DNS
WEMASY includes everything you need to run a professional website on your own domain. When you connect a custom domain, the platform guides you through the DNS records required for your site. WEMASY email hosting is coming soon; until then your MX records point to your own email provider.
Domain management, hosting, SSL, and your website builder all live in one WEMASY subscription. See what is included on the WEMASY pricing page.
What comes next
With your MX record configured, email sent to your domain reaches the right server. For the web side of DNS, revisit what an A record is, or follow the guide on how to set up email on your domain for the complete email setup process.
Frequently asked questions
Can I use the same domain for both website and email?
Yes. Your A record handles website traffic and your MX record handles email delivery. Both records coexist in your DNS zone without conflict. This is the standard setup for professional email at your own domain. With WEMASY's website builder, you can set this up directly on your website.
What happens if I have no MX record?
Email sent to your domain will bounce. Sending mail servers look for an MX record and, if none exists, they cannot determine where to deliver messages. Your website may still load normally because web traffic uses A records, not MX records.
Can I point MX records to an IP address?
No. MX records must contain a hostname, not an IP address. The hostname resolves through its own A record to reach the mail server. Your email provider will give you the correct hostname to use.
How many MX records can a domain have?
There is no strict limit. Most domains use one or two MX records. Multiple records with different priority values provide backup delivery if the primary mail server is unavailable. Follow your email provider's recommendations for the exact number and values.
Will changing my A record break my email?
Not if you leave your MX records unchanged. A records and MX records are independent. You can point your website at a new server by updating the A record without touching email configuration. Always verify MX records after any DNS edit to be safe.
How long does an MX record change take to propagate?
The same TTL rules apply as with any DNS record. With a low TTL, most mail servers pick up the change within minutes. With a high TTL, it can take hours. Lower TTL before switching email providers to reduce the window where mail might route to the old server.