Key takeaways
- Create two MX records, 10 mxa.mailgun.org and 10 mxb.mailgun.org, on the domain or subdomain that should receive mail through Mailgun.
- Confirm them with dig MX, then create a receiving route in Mailgun for the addresses you want handled.
- Do not point the root domain at Mailgun unless you intend to move all inbound mail there.
To set up MX records for Mailgun, add two MX records at the name that will receive mail, pointing to `mxa.mailgun.org` and `mxb.mailgun.org`, both at priority 10. Mailgun's domain verification guide lists these values under receiving (MX), which routes and stores mail sent to the domain. Be deliberate about the name: an MX record at your root domain takes over every inbound message to that domain, including your normal mailbox.
Research checked: 12 November 2026
This guide covers setup only. Planning MX for cold-reply handling and fixing receiving failures are in the other two MX guides.
The short answer
Create two MX records, `10 mxa.mailgun.org` and `10 mxb.mailgun.org`, on the domain or subdomain that should receive mail through Mailgun. Confirm them with `dig MX`, then create a receiving route in Mailgun for the addresses you want handled. Do not point the root domain at Mailgun unless you intend to move all inbound mail there.
Setup steps
Step 1: Decide which name receives mail
Mailgun's verification guide lists four records: SPF, DKIM, tracking and MX. The MX values are the receiving pair. The verification table marks them as required, so do not omit them when you follow Mailgun's flow, but do choose the name carefully.
If your company email is hosted elsewhere on the root domain, do not put these records on the root. Use a subdomain such as `replies.example.com` for mail Mailgun should receive, and leave the root MX unchanged.
Step 2: Create the records
Enter the two MX records at the chosen name:
``` replies.example.com. MX 10 mxa.mailgun.org. replies.example.com. MX 10 mxb.mailgun.org. ```
Both carry priority 10, so receivers balance between them. Some DNS hosts want the trailing dot left out, or add the domain automatically. Enter the short name in that case, following the pattern your existing records use.
Step 3: Verify with dig
``` dig +short MX replies.example.com ```
The expected output lists both Mailgun hosts with priority 10. If the answer is empty, the record is at a different name or has not propagated. Mailgun states that DNS changes can take 24 to 48 hours to fully propagate, so an empty answer in the first hour is not a failure yet.
Step 4: Confirm receiving works
After the answer returns, send a message to an address on the receiving name and check that Mailgun records it. Mailgun needs a receiving route configured for the address before it does anything with the message. Confirm the route in the control panel, then check the stored message there, rather than assuming delivery because DNS looks right. If no route matches, treat the address as unhandled and fix the route before blaming DNS.
What to watch for before you go further
Adding MX at the root sends every inbound message for that domain to Mailgun, not only the ones you intended. That includes mail from colleagues, invoices and password resets, so check the effect before publishing.
Here is what a root change does. Suppose `example.com` currently receives mail at `mx1.existing-host.example`, and you add the Mailgun pair at the root. Delivery to `alex@example.com` now targets Mailgun, not the existing host, so the mailbox at that host stops receiving anything until you change the records back or forward the mail. Write down the current MX answer with `dig +short MX example.com` before you touch anything, so you can restore it.
If you must use the root, plan for forwarding from Mailgun to the real mailbox and test it with a message from outside your organisation. Otherwise keep receiving on a subdomain and leave the root untouched.