latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

Mail
Mail DNS Settings

Add manual mail exchanger redirect record

This function lets you create a manual Exim mail exchanger (MX) redirect for a domain. An MX redirection lets you bypass the domain's MX lookup via the Domain Name System (DNS). This function adds the manual redirect entries to the /etc/manualmx file.

Note:

To remove a domain's manual MX redirection, use the WHM API 1 unset_manual_mx_redirect function.

get/set_manual_mx_redirects

Query parameters

domainstring required
Example:example.com

The domain for which to add a manual MX redirect entry.

Note:

To add multiple domain entries, increment the parameter. For example, use the domain, domain-1, and domain-2 parameters. For multiple domains, you must include its corresponding mx_host value.

mx_hoststring required
Example:mailhostexample.com

The domain or IP address (IPv4 or IPv6) to redirect the domain value's emails to.

Note:

To add multiple MX hosts, increment the parameter. For example, use the  mx_host,  mx_host-1, and  mx_host-2 parameters. For multiple MX hosts, you must include its corresponding domain value.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "payload": {
      "example.com": "mailhostexample.com",
      "example.org": null
    }
  },
  "metadata": {
    "command": "set_manual_mx_redirects",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}