Replacing all existing MX Records using the API requires specific syntax depending on whether you are using REST or SOAP. Use this table to find the syntax for your command.
See RFC 1035 for more information about MX records.
Understanding How The API Works »
REST Syntax
Click to view all REST Resources |
/REST/MXRecord/ PUT — Replace all existing MX Record on the zone/node indicated.
HTTP Action — PUT
URI — https://api.dynect.net/REST/MXRecord/<zone>/<fqdn>/ |
Arguments — Click for More Info
- array
MXRecords — Required. Individual records.
- hash
rdata — Required. RData defining the record(s) to replace.
- string
exchange — Required. Hostname of the server responsible for accepting mail messages in the zone.
- string
preference — Required. Numeric value for priority usage. Lower value takes precedence over higher value where two records of the same type exist on the zone/node. Default = 10.
- string
ttl — TTL for the record in seconds. Set to “0” to use zone default.
|
Response — Click for More Info
- array — Individual records.
- string
fqdn — Fully qualified domain name of a node in the zone.
- hash
rdata — RData defining the record(s) to replace.
- string
exchange — Hostname of the server responsible for accepting mail messages in the zone.
- string
preference — Numeric value for priority usage. Lower value takes precedence over higher value where two records of the same type exist on the zone/node. Default = 10.
- string
record_type — The RRType of the record.
- string
ttl — TTL for the record.
- string
zone — Name of the zone.
|
SOAP Syntax
Click to view all SOAP Commands |
ReplaceMXRecords — Replace all existing MX Record on the zone/node indicated. |
Arguments — Click for More Info
- array
MXRecords — Required.
- string
fqdn — Required. Name of node where the record exists.
- hash
rdata — Required. RData defining the record(s) to replace.
- string
exchange — Required. Hostname of the server responsible for accepting mail messages in the zone.
- string
preference — Required. Numeric value for priority usage. Lower value takes precedence over higher value where two records of the same type exist on the zone/node. Default = 10.
- string
ttl — TTL for the record in seconds. Set to “0” to use zone default.
- string
zone — Required. Name of zone where the record exists.
- string
token — Required. The session identifier.
|
Response — Click for More Info
- array
data
- string
fqdn — Fully qualified domain name of a node in the zone.
- hash
rdata — RData defining the record.
- string
exchange — Hostname of the server responsible for accepting mail messages in the zone.
- string
preference — Numeric value for priority usage. Lower value takes precedence over higher value where two records of the same type exist on the zone/node. Default = 10.
- string
record_id — A numeric identifier for the record.
- string
record_type — The RRType of the record.
- string
ttl — TTL for the record.
- string
zone — Name of the zone.
|
Example Request — Click for More Info
{
'MXRecords' => [
{
'fqdn' => 'www.example.com',
'rdata' => {
'preference' => '10',
'exchange' => 'mx1.example.net',
},
'ttl' => '3600',
'zone' => 'example.com',
},
{
'fqdn' => 'www.example.com',
'rdata' => {
'preference' => '20',
'exchange' => 'mx2.example.net',
},
'ttl' => '3600',
'zone' => 'example.com',
}
],
'token' => 'asdlkfjasl23j4879afa',
}
|
DNS API Knowledge Base