Receive mail with MX records
Add an MX record that names your mail servers and their priorities in Edge DNS, from Azion Console, the Azion CLI, or the API, and check the answer with dig.
You can add an MX record to a zone in Edge DNS from Azion Console, the Azion CLI, or the Azion API. The record below names two mail servers for example.com, each with a priority, so that mail sent to addresses at the domain reaches them. To add another type of record, refer to Add, edit, or delete a record.
Choose the interface you work in. The prerequisites and the steps to add the record follow that choice.
Prerequisites
- A zone for your domain in Edge DNS. To create one, refer to Create, edit, or delete a zone.
- The hostname and the priority of each mail server, as your mail provider gives them.
- The Edit Edge DNS permission. Refer to Teams permissions.
- Access to Azion Console. To sign in, refer to Access Azion Console.
Add the MX record
One MX record holds every mail server for a name, one value per server, up to 10 values. Each value is a priority, a space, and the mail server’s hostname. The record goes on @, the zone apex, to receive mail for addresses such as user@example.com. For the rules of the value, refer to MX.
To add the record with the Azion CLI, repeat --rdata once per mail server. Replace <zone-id> with the ID of your zone:
The command prints the ID of the record:
To read the record, list the records of the zone:
The MX record shows both values in one row, separated by a comma:
The zone holds one MX record on @ with two mail servers.
A second MX record on the same name is refused with 19004 Record Already Exists. To add a mail server later, edit the existing record and add a value.
Check the answer
Ask Azion’s nameserver directly, without your resolver’s cache, for the MX record of the domain. Replace example.com with your domain:
The nameserver returns one line per value, with the priority first:
If the command prints nothing, refer to A new record returns NXDOMAIN. A change to an existing MX record can take a few minutes to reach every nameserver. For the reasons, refer to Caching and propagation.