Dns-zone-records-recordId:PUT
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision) |
|||
Line 24: | Line 24: | ||
=== Request Body === | === Request Body === | ||
+ | |||
+ | Added support for wildcard domain names. | ||
+ | Ex: | ||
+ | * | ||
+ | *.somedomain.com | ||
+ | The wildcard record name is stored in the database as it is supplied. | ||
+ | If it's missing the zone origin(i.e. '*') the API will return it with the zone | ||
+ | appended, i.e. '*.domain.com'. | ||
+ | |||
+ | |||
+ | Added support for @ records, which represent the origin itself. | ||
+ | Ex: | ||
+ | @ | ||
+ | The API will return the record with the zone origin appended to the name, i.e. '@.domain.com' | ||
====A record==== | ====A record==== | ||
<nowiki> | <nowiki> | ||
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"A", | + | "type": "A", |
− | "address":{ip_address} | + | "address": {ip_address}, |
− | + | "ttl": 3600 | |
− | + | }</nowiki> | |
====AAAA record==== | ====AAAA record==== | ||
− | + | <nowiki> | |
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"AAAA", | + | "type": "AAAA", |
− | "address":{ipv6_address} | + | "address": {ipv6_address}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
====NS record==== | ====NS record==== | ||
− | + | <nowiki> | |
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"NS", | + | "type": "NS", |
− | "nsdname":{ns_domain} | + | "nsdname": {ns_domain}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
====TXT record==== | ====TXT record==== | ||
− | + | <nowiki> | |
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"TXT", | + | "type": "TXT", |
− | "data":{data} | + | "data": {data}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
====SRV record==== | ====SRV record==== | ||
− | + | <nowiki> | |
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"SRV", | + | "type": "SRV", |
"priority": {priority}, | "priority": {priority}, | ||
"weight": {weight}, | "weight": {weight}, | ||
"port": {port}, | "port": {port}, | ||
− | "target":{target} | + | "target": {target}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
====MX record==== | ====MX record==== | ||
− | + | <nowiki> | |
{ | { | ||
− | "name":{domain}, | + | "name": {domain}, |
− | "type":"MX", | + | "type": "MX", |
"preference": {preference}, | "preference": {preference}, | ||
− | "exchange":{mx_domain} | + | "exchange": {mx_domain}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
====CNAME record==== | ====CNAME record==== | ||
<nowiki> | <nowiki> | ||
{ | { | ||
− | "name":{name}, | + | "name": {name}, |
− | "type":"CNAME", | + | "type": "CNAME", |
− | "cname":{domain} | + | "cname": {domain}, |
− | + | "ttl": 3600 | |
− | </nowiki> | + | }</nowiki> |
== Response == | == Response == | ||
=== Status Code === | === Status Code === | ||
− | ; 200 OK | + | ; 200 OK : Success |
− | : Success | + | |
− | ; 400 Bad Request | + | ; 400 Bad Request : TTL is below allowed minimum |
− | : | + | |
− | ; 401 Unauthorized | + | ; 401 Unauthorized : |
− | : | + | |
− | ; 403 Forbidden | + | ; 403 Forbidden : |
− | : | + | |
− | ; 409 Conflict | + | ; 409 Conflict : |
− | : | + | |
=== Response Body === | === Response Body === | ||
Line 124: | Line 133: | ||
"type": "CNAME", | "type": "CNAME", | ||
"cname": "otherdomain.com." | "cname": "otherdomain.com." | ||
− | } | + | }</nowiki> |
− | + | ||
''Response'' | ''Response'' | ||
<nowiki> | <nowiki> | ||
401 Unauthorized | 401 Unauthorized | ||
− | + | </nowiki> | |
=== Successful Update === | === Successful Update === | ||
Line 143: | Line 151: | ||
"type": "CNAME", | "type": "CNAME", | ||
"cname": "otherdomain1.com." | "cname": "otherdomain1.com." | ||
− | } | + | }</nowiki> |
− | + | ||
''Response'' | ''Response'' | ||
Line 154: | Line 161: | ||
"type": "CNAME", | "type": "CNAME", | ||
"cname": "otherdomain1.com." | "cname": "otherdomain1.com." | ||
− | } | + | }</nowiki> |
− | + | ||
== See also == | == See also == |
Revision as of 05:54, 25 April 2014
PUT /dns/{zone}/records/{recordId}
Update an existing zone record.
Contents |
Request
PUT /dns/{zone}/records/{recordId}
Request Parameters
- zone - string
- The DNS zone of the record.
- recordId - string
- The uniques Id of the record.
URI Parameters
None.
Request Headers
- Content-Type
- application/json
- Authorization
- Base64-encoded username & password string
Request Body
Added support for wildcard domain names. Ex: * *.somedomain.com The wildcard record name is stored in the database as it is supplied. If it's missing the zone origin(i.e. '*') the API will return it with the zone appended, i.e. '*.domain.com'.
Added support for @ records, which represent the origin itself. Ex: @ The API will return the record with the zone origin appended to the name, i.e. '@.domain.com'
A record
{ "name": {domain}, "type": "A", "address": {ip_address}, "ttl": 3600 }
AAAA record
{ "name": {domain}, "type": "AAAA", "address": {ipv6_address}, "ttl": 3600 }
NS record
{ "name": {domain}, "type": "NS", "nsdname": {ns_domain}, "ttl": 3600 }
TXT record
{ "name": {domain}, "type": "TXT", "data": {data}, "ttl": 3600 }
SRV record
{ "name": {domain}, "type": "SRV", "priority": {priority}, "weight": {weight}, "port": {port}, "target": {target}, "ttl": 3600 }
MX record
{ "name": {domain}, "type": "MX", "preference": {preference}, "exchange": {mx_domain}, "ttl": 3600 }
CNAME record
{ "name": {name}, "type": "CNAME", "cname": {domain}, "ttl": 3600 }
Response
Status Code
- 200 OK
- Success
- 400 Bad Request
- TTL is below allowed minimum
- 401 Unauthorized
- 403 Forbidden
- 409 Conflict
Response Body
None.
Examples
Unauthorized Request
Request
PUT /dns/test.com/records/1234 { "name": "test", "type": "CNAME", "cname": "otherdomain.com." }
Response
401 Unauthorized
Successful Update
Request
PUT /dns/test.com/records/1234 Authorization: Basic {base64_encoded(username:password)} { "name": "test1", "type": "CNAME", "cname": "otherdomain1.com." }
Response
200 OK { "name": "test1", "type": "CNAME", "cname": "otherdomain1.com." }
See also