What an MX record does
When someone sends email to you@example.com, their mail server looks up the MX records for example.com and delivers the message to the server named there.
Email and the website can run on different servers. The A record points visitors to the website; the MX record points email to the server that receives it.
- Name: the domain the record is for, often shown as
@. - Priority: a number such as 0, 10 or 20. Senders try the lowest number first and move to the next if that server does not answer. Records with the same number share the mail.
- Mail server: a hostname such as
mail.example.com. It needs its own A (or AAAA) record. An IP address or a CNAME is not allowed here. - TTL: how many seconds other servers may keep a copy of the record before they look it up again.
- Written out, a record looks like
example.com. 3600 IN MX 10 mail.example.com.
How to check MX records
Any of these shows the MX records the internet sees for your domain. Replace example.com with your domain.
- On macOS or Linux, open a terminal and run
dig MX example.com +short. - On Windows, open Command Prompt and run
nslookup -type=MX example.com. - Or use any online DNS lookup tool and choose the MX record type.
- Read each result: the priority number comes first, then the mail server.
- Check that each mail server has an address: run
dig A mail.example.com +shortwith its hostname. - In cPanel, open Zone Editor and select Manage next to the domain to see the records your hosting holds. They take effect only if the domain uses your hosting’s nameservers.
How to change MX records
Change MX records where the domain’s DNS is managed. If the domain uses your hosting’s nameservers, that is cPanel’s Zone Editor. If not, it is your registrar or a DNS provider such as Cloudflare, and the steps there are much the same.
To see which, run dig NS example.com +short and compare the result with the nameservers in your welcome email or client area. For more on nameservers, see how to connect a domain to your hosting.
- Note the current MX records, so you can switch back.
- Sign in to cPanel and open Zone Editor.
- Select Manage next to the domain.
- Filter the list by MX.
- To change a record, select Edit next to it.
- To add a record, select Add Record and choose MX.
- Enter the priority and the mail server hostname.
- Select Save Record.
- Delete any MX record that points to a mail server you no longer use.
MX records for Google Workspace or Microsoft 365
An outside email service gives you its own MX values. Copy them exactly from its setup page, not from an old guide, as they change from time to time.
Set cPanel’s Email Routing to Remote Mail Exchanger as well, even when your DNS is elsewhere. Otherwise the hosting server can keep mail sent from your own website, such as contact form messages, instead of passing it on.
- Note the current MX records, so you can switch back.
- Sign in to the email service’s admin console and open its domain setup.
- If it asks you to verify the domain, add the TXT record it gives where your DNS is managed.
- Copy each MX record it lists, with its priority.
- Add those MX records where your DNS is managed.
- Delete the old MX records, so no mail goes to the old server.
- In cPanel, open Email Routing.
- Choose the domain.
- Select
Remote Mail Exchanger, then Change. - Back in the admin console, finish the setup so the service checks the new records.
How long MX record changes take
Senders see a new MX record once the old record’s TTL runs out, often within a few hours. Allow up to 48 hours for every network.
- A day before the change, lower the MX records’ TTL to
300seconds, so the switch spreads faster. - Keep the old mail server working for 48 hours after the change, so mail sent during the switch is not lost.
- Run
dig MX example.com +shortuntil it shows the new values. - Send a test email from an address outside your domain.
- Once mail arrives, set the TTL back to its old value.
SPF, DKIM and DMARC records
MX records control only incoming mail. Three TXT records protect mail sent from your domain: SPF lists the servers allowed to send it, DKIM adds a signature that receivers check, and DMARC tells receivers what to do when those checks fail. When you change email services, update SPF and DKIM to match, or your mail may land in spam.
HostUpIndia Web & cPanel Hosting
HostUpIndia Web & cPanel Hosting includes cPanel for the DNS steps above, plus free SSL, LiteSpeed, NVMe storage, terminal (SSH) access, the AI Website Builder and daily backups kept 30 days. Plans start at ₹49 a month on 3-year billing. Prices exclude 18% GST.
- New to cPanel? See what cPanel is.
- Moving from another host? The in-house team moves your site for you: free website migration.
- Need a hand with DNS? Support tickets and email are received 24 hours a day, 7 days a week; WhatsApp is open for questions from 10 am to 7 pm IST, Monday to Saturday.
- More help guides.
