Dns-zone-records-recordId:PUT

From Hostway API Documentation
Jump to: navigation, search

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