Dns-zone-records-recordId:PUT

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
(Created page with "= PUT /dns/''{zone}''/records/''{recordId}'' = Update an existing zone record. __TOC__ == Request == <code>PUT /dns/''{zone}''/records/''{recordId}''</code> ==== Request Par...")
 
m (1 revision: Release 99)
 
(5 intermediate revisions by 2 users not shown)
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",  
+
     "address": {ip_address},
     "address":{ip_address}
+
     "ttl": 3600
}
+
}</nowiki>
</nowiki>
+
  
 
====AAAA record====
 
====AAAA record====
  <nowiki>
+
<nowiki>
 
{  
 
{  
     "name":{domain},
+
     "name": {domain},
     "type":"AAAA",  
+
     "address": {ipv6_address},
     "address":{ipv6_address}
+
     "ttl": 3600
}
+
}</nowiki>
</nowiki>
+
  
 
====NS record====
 
====NS record====
  <nowiki>
+
<nowiki>
 
{  
 
{  
     "name":{domain},  
+
     "name": {domain},  
     "type":"NS",  
+
     "nsdname": {ns_domain},
     "nsdname":{ns_domain}
+
     "ttl": 3600
}
+
}</nowiki>
</nowiki>
+
  
 
====TXT record====
 
====TXT record====
  <nowiki>
+
<nowiki>
 
{  
 
{  
     "name":{domain},
+
     "name": {domain},
     "type":"TXT",  
+
     "data": {data},
     "data":{data}
+
     "ttl": 3600
}
+
}</nowiki>
</nowiki>
+
  
 
====SRV record====
 
====SRV record====
  <nowiki>
+
<nowiki>
 
{  
 
{  
     "name":{domain},
+
     "name": {domain},
    "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>
+
<nowiki>
 
{  
 
{  
     "name":{domain},
+
     "name": {domain},  
    "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",  
+
     "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 122: Line 124:
 
{
 
{
 
   "name": "test",
 
   "name": "test",
  "type": "CNAME",
 
 
   "cname": "otherdomain.com."
 
   "cname": "otherdomain.com."
}
+
}</nowiki>
</nowiki>
+
  
 
''Response''
 
''Response''
 
  <nowiki>
 
  <nowiki>
 
401 Unauthorized  
 
401 Unauthorized  
</nowiki>
+
</nowiki>
  
 
=== Successful Update ===
 
=== Successful Update ===
Line 141: Line 141:
 
{
 
{
 
   "name": "test1",
 
   "name": "test1",
  "type": "CNAME",
 
 
   "cname": "otherdomain1.com."
 
   "cname": "otherdomain1.com."
}
+
}</nowiki>
</nowiki>
+
  
 
''Response''
 
''Response''
Line 154: Line 152:
 
   "type": "CNAME",
 
   "type": "CNAME",
 
   "cname": "otherdomain1.com."
 
   "cname": "otherdomain1.com."
}
+
}</nowiki>
</nowiki>
+
  
 
== See also ==
 
== See also ==

Latest revision as of 09:08, 14 October 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},
    "address": {ip_address},
    "ttl": 3600
}

AAAA record

{ 
    "name": {domain},
    "address": {ipv6_address},
    "ttl": 3600
}

NS record

{ 
    "name": {domain}, 
    "nsdname": {ns_domain},
    "ttl": 3600
}

TXT record

{ 
    "name": {domain},
    "data": {data},
    "ttl": 3600
}

SRV record

{ 
    "name": {domain},
    "priority": {priority}, 
    "weight": {weight}, 
    "port": {port}, 
    "target": {target},
    "ttl": 3600
}

MX record

{ 
    "name": {domain}, 
    "preference": {preference}, 
    "exchange": {mx_domain},
    "ttl": 3600
}

CNAME record

{ 
    "name": {name},
    "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",
  "cname": "otherdomain.com."
}

Response

401 Unauthorized 

Successful Update

Request

PUT /dns/test.com/records/1234
Authorization: Basic {base64_encoded(username:password)}

{
  "name": "test1",
  "cname": "otherdomain1.com."
}

Response

200 OK

{
  "name": "test1",
  "type": "CNAME",
  "cname": "otherdomain1.com."
}

See also


blog comments powered by Disqus

Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox