Description

This function creates a new MX record.

Examples 


https://hostname.example.com:2087/cpsess##########/json-api/savemxs?api.version=1&domain=example.com&name=mail&exchange=ns1.example.com&preference=10&ttl=14400
https://hostname.example.com:2087/cpsess##########/xml-api/savemxs?api.version=1&domain=example.com&name=mail&exchange=ns1.example.com&preference=10&ttl=14400
whmapi1 savemxs domain=example.com name=mail exchange=ns1.example.com preference=10 ttl=14400

{
  "metadata": {
    "result": 1,
    "reason": "Bind reloading on server1 using rndc zone: [example.com]\n",
    "version": 1,
    "command": "savemxs"
  }
}
<result>
    <metadata>
        <result>1</result>
        <reason>Bind reloading on server1 using rndc zone: [example.com]</reason>
        <version>1</version>
        <command>savemxs</command>
    </metadata>
</result>

Parameters

ParameterTypeDescriptionPossible valuesExample

domain

string

Required

The zone record's domain.

A valid domain name on the server.example.com

name

string

Required

The record name.

A valid domain name or hostname.

mail.example.com

exchange

string

Required

The domain's mail exchanger.

A valid mail exchanger.mail.example.com

preference

integer

Required

The MX record's priority order.

An integer that represents the record's priority order.

Lower numbers indicate a higher priority order. 

20

class

string

The record's class.

This value defaults to IN.

  • IN
  • Very rarely, another valid DNS record class.

IN
ttlintegerThe record's Time To Live (TTL).

A positive integer that represents the TTL, in seconds.

86400
serialnumintegerThe record's serial number.A valid serial number.2013122501

Returns

This function only returns metadata.