How to add or edit MX records Print

  • mx record, dns, email, mail delivery
  • 1

An MX (Mail Exchange) record is the DNS record that tells other mail servers which server receives email for your domain. Without a correct MX record your domain cannot receive mail at all.

How an MX record is built

Each record has two parts: a priority and a host name.

example.com.    MX    10    mail.example.com.
  • Priority — a number. The lower the number, the higher the priority: sending servers try the lowest first and move on to the next only if it does not respond. This is how a backup mail server is configured — for example 10 for the main server and 20 for the standby.
  • Host name — the name of the mail server. It must be a name, not an IP address, and that name must itself resolve to an address.

Giving two servers the same priority spreads mail between them at random. Unless both are genuinely equivalent and share mailboxes, this causes messages to land in different places, so use different numbers.

Where to change the record

The MX record lives wherever your domain's DNS is hosted:

  • In your control panel, if DNS is served from your server — see Managing DNS records in Plesk for Plesk, or the DNS section of your panel.
  • At your registrar or DNS provider, if the domain is served elsewhere. Changing the record in your panel has no effect in that case, because nobody is asking your server.

If you are not sure which applies, check which nameservers the domain uses before editing anything.

Moving mail to an external provider

This is the most common reason for editing MX records. Two points that catch people out:

  • Remove the old records. Adding the new provider's MX record without deleting the existing one leaves two destinations, and mail will arrive at both more or less arbitrarily.
  • Disable local mail delivery. If your server still thinks it handles mail for the domain, messages sent from the server itself — order confirmations, password resets — will be delivered locally instead of going to the external provider, and will never appear in your mailbox. In Plesk this is the mail service setting for the domain.

SPF, DKIM and DMARC

The MX record only governs incoming mail. Whether your outgoing mail is accepted rather than treated as spam depends on the SPF, DKIM and DMARC records, which are separate TXT records. When changing mail provider, update those at the same time — otherwise mail continues to arrive but your own messages start being rejected.

After the change

MX changes are subject to the same caching as any DNS record, so allow time before concluding that something is wrong — see How long does DNS propagation take?

Check the result by querying DNS directly rather than by sending yourself a test message:

dig MX example.com
dig @1.1.1.1 MX example.com

Keep the old mailboxes for a while after moving mail elsewhere. During propagation some senders still deliver to the old server, and deleting it immediately loses those messages.

If mail is not arriving after the change, open a ticket from your client area with the domain name and, if you have it, the error returned to the sender.


Was this answer helpful?

« Back