Dns-zone-records-recordId:PUT

From Hostway API Documentation
(Difference between revisions)
Jump to: navigation, search
m (1 revision: Release 99)
 
(3 intermediate revisions by one user not shown)
Line 43: Line 43:
 
{  
 
{  
 
     "name": {domain},
 
     "name": {domain},
    "type": "A",
 
 
     "address": {ip_address},
 
     "address": {ip_address},
 
     "ttl": 3600
 
     "ttl": 3600
Line 52: Line 51:
 
{  
 
{  
 
     "name": {domain},
 
     "name": {domain},
    "type": "AAAA",
 
 
     "address": {ipv6_address},
 
     "address": {ipv6_address},
 
     "ttl": 3600
 
     "ttl": 3600
Line 61: Line 59:
 
{  
 
{  
 
     "name": {domain},  
 
     "name": {domain},  
    "type": "NS",
 
 
     "nsdname": {ns_domain},
 
     "nsdname": {ns_domain},
 
     "ttl": 3600
 
     "ttl": 3600
Line 70: Line 67:
 
{  
 
{  
 
     "name": {domain},
 
     "name": {domain},
    "type": "TXT",
 
 
     "data": {data},
 
     "data": {data},
 
     "ttl": 3600
 
     "ttl": 3600
Line 79: Line 75:
 
{  
 
{  
 
     "name": {domain},
 
     "name": {domain},
    "type": "SRV",
 
 
     "priority": {priority},  
 
     "priority": {priority},  
 
     "weight": {weight},  
 
     "weight": {weight},  
Line 91: Line 86:
 
{  
 
{  
 
     "name": {domain},  
 
     "name": {domain},  
    "type": "MX",
 
 
     "preference": {preference},  
 
     "preference": {preference},  
 
     "exchange": {mx_domain},
 
     "exchange": {mx_domain},
Line 101: Line 95:
 
{  
 
{  
 
     "name": {name},
 
     "name": {name},
    "type": "CNAME",
 
 
     "cname": {domain},
 
     "cname": {domain},
 
     "ttl": 3600
 
     "ttl": 3600
Line 131: Line 124:
 
{
 
{
 
   "name": "test",
 
   "name": "test",
  "type": "CNAME",
 
 
   "cname": "otherdomain.com."
 
   "cname": "otherdomain.com."
 
}</nowiki>
 
}</nowiki>
Line 149: Line 141:
 
{
 
{
 
   "name": "test1",
 
   "name": "test1",
  "type": "CNAME",
 
 
   "cname": "otherdomain1.com."
 
   "cname": "otherdomain1.com."
 
}</nowiki>
 
}</nowiki>

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