/go/mx is a short shortcut for adding an MX (mail exchanger) record to a domain's DNS zone on Cloudflare. MX records tell other mail servers where to deliver email for the domain. It does not talk to Cloudflare itself. It passes your arguments to cloudflare, which makes the change through the Cloudflare API. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Send the domain's mail to mail.example.com
/go/mx example.com mail.example.com
Arguments
| Position | Name | Required | Notes |
|---|---|---|---|
| 1 | <domain> |
Yes | The domain whose DNS zone receives the record. It must already be on Cloudflare. |
| 2 | <mail-server> |
Yes | The hostname of the mail server, such as mail.example.com. Use a hostname, not an IP address. |
| 3 | [priority] |
No | MX priority. A lower number is tried first. If omitted, the default is chosen by cloudflare. |
The command does not check its arguments. If an argument is missing or contains a space, it is passed on as is, and cloudflare may fail or misread the values.
Examples
# One mail server, default priority
/go/mx example.com mail.example.com
# Primary mail server with priority 10
/go/mx example.com mail.example.com 10
# Add a backup mail server with a higher number, so it is tried second
/go/mx example.com mail2.example.com 20
# Check the result
dig MX example.com +short
/go/checkmx
Output
/go/mx prints nothing of its own. The messages you see, and the exit code, come from cloudflare. Every call is also appended to /var/log/go/mx.log.
See the full reference at /go/mx and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
