Skip to content
Open console

MX Records

An MX record routes email for your domain to a mail server. Each MX record has a priority (a preference number) and a mail server hostname. Mail delivery tries the lowest priority number first.

FieldExampleNotes
Name@Usually the apex, so mail addresses are @your-domain.
TypeMX
Priority100 to 65535. ZCP prefers lower values. Required for MX.
Contentmail.example.com.The mail server hostname. End it with a trailing dot.
TTL3600Seconds.

Console: choose type MX, set Priority and the mail server value in their own fields.

@ MX 10 mail.example.com. 3600

CLI (MX requires --priority):

zcp dns record-create --domain examplecom --name @ --type MX \
--content mail.example.com. --priority 10 --ttl 3600

API (send priority as a separate field):

curl -s -X POST "https://api.zcp.zsoftly.ca/api/dns/domains/examplecom/records" \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{ "name": "@", "type": "MX", "content": "mail.example.com.", "priority": 10, "ttl": 3600 }'
dig MX example.com +short
# 10 mail.example.com.

A name and type hold several values. Creating a second MX record at @ adds it to the set. Publish a primary and a backup mail server on the same name. Give each its own priority. A lower number is preferred. See Several values per name and type.

  • Priority is separate. Do not put the number in the value (10 mail.example.com.). The console, CLI, and API each take priority in its own field.
  • The mail server needs an address. The MX target must resolve to an A or AAAA record. It cannot point at a CNAME.
  • A 0 priority is valid and is sent correctly.

See also: TXT records for SPF and DKIM, Worked examples, Record types

Ask the ZCP docs

Type a question and pick an assistant. The assistant opens in a new tab and reads this page and the full ZCP documentation, so its answer comes from our docs.

Example questions

Ask with

Your question goes to the assistant you pick, under its own terms.