Dns-zone-records:POST
From Hostway API Documentation
(Difference between revisions)
Corinne.chui (Talk | contribs) m (1 revision) |
|||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 34: | Line 34: | ||
@ | @ | ||
The API will return the record with the zone origin appended to the name, i.e. '@.domain.com' | The API will return the record with the zone origin appended to the name, i.e. '@.domain.com' | ||
| + | |||
====A record==== | ====A record==== | ||
<nowiki> | <nowiki> | ||
| Line 42: | Line 43: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; address | ||
| + | : IPv4 address | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====AAAA record==== | ====AAAA record==== | ||
| Line 51: | Line 61: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; address | ||
| + | : IPv6 address | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====NS record==== | ====NS record==== | ||
| Line 60: | Line 79: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; nsdname | ||
| + | : FQDN of the host which should be authoritative for the domain | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====TXT record==== | ====TXT record==== | ||
| Line 69: | Line 97: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; data | ||
| + | : TXT record data | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====SRV record==== | ====SRV record==== | ||
| Line 81: | Line 118: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; priority | ||
| + | : The priority of this target host | ||
| + | |||
| + | ; weight | ||
| + | : Server selection mechanism | ||
| + | |||
| + | ; port | ||
| + | : The port on this target host of this service | ||
| + | |||
| + | ; target | ||
| + | : The domain name of the target host | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====MX record==== | ====MX record==== | ||
| Line 91: | Line 146: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; preference | ||
| + | : Integer which specifies the preference given to this record among others at the same owner | ||
| + | |||
| + | ; exchange | ||
| + | : FQDN which specifies a host willing to act as a mail exchange for the owner name | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
====CNAME record==== | ====CNAME record==== | ||
| Line 100: | Line 167: | ||
"ttl": 3600 | "ttl": 3600 | ||
}</nowiki> | }</nowiki> | ||
| + | |||
| + | ; name | ||
| + | : Fully qualified domain name (FQDN) of the record | ||
| + | |||
| + | ; cname | ||
| + | : FQDN which specifies the canonical or primary name for the owner | ||
| + | |||
| + | ; ttl | ||
| + | : Time to live (TTL) for the record in seconds | ||
== Response == | == Response == | ||
=== Status Code === | === Status Code === | ||
| − | ; | + | ; 201 OK : Success |
; 400 Bad Request : TTL is below allowed minimum | ; 400 Bad Request : TTL is below allowed minimum | ||
| Line 111: | Line 187: | ||
; 404 Not Found : The specified zone does not exist. | ; 404 Not Found : The specified zone does not exist. | ||
| + | |||
| + | ; 409 Conflict : Requested record conflicts with existing one. | ||
=== Response Header === | === Response Header === | ||
| Line 125: | Line 203: | ||
{ | { | ||
| − | "name": "test", | + | "name": "alt.test.com", |
"type": "CNAME", | "type": "CNAME", | ||
| − | "cname": " | + | "cname": "altdomain.com" |
}</nowiki> | }</nowiki> | ||
| Line 142: | Line 220: | ||
{ | { | ||
| − | "name": "test", | + | "name": "alt.test.com", |
"type": "CNAME", | "type": "CNAME", | ||
| − | "cname": " | + | "cname": "altdomain.com" |
}</nowiki> | }</nowiki> | ||
| Line 159: | Line 237: | ||
{ | { | ||
| − | "name": "test", | + | "name": "alt.test.com", |
"type": "CNAME", | "type": "CNAME", | ||
| − | "cname": " | + | "cname": "altdomain.com" |
}</nowiki> | }</nowiki> | ||
| Line 175: | Line 253: | ||
* [[DNS|DNS API]] | * [[DNS|DNS API]] | ||
* [[Common Features]] | * [[Common Features]] | ||
| + | * [http://tools.ietf.org/html/rfc1035 RFC 1035] | ||
| + | * [http://tools.ietf.org/html/rfc2782 RFC 2782] | ||
{{disqus}} | {{disqus}} | ||
[[Category:Hostway API]] | [[Category:Hostway API]] | ||
[[Category:DNS API]] | [[Category:DNS API]] | ||
| − | |||
Latest revision as of 19:35, 18 August 2016
[edit] POST /dns/{zone}/records
Creates new DNS zone records.
Contents |
[edit] Request
POST /dns/{zone}/records
[edit] Parameters
- zone - string
- The name of the DNS zone.
[edit] URI Parameters
None.
[edit] Request Headers
- Authorization
- Base64-encoded username:password string
- Content-Type
- application/json
[edit] 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'
[edit] A record
{
"name": "{domain}",
"type": "A",
"address": "{ip_address}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- address
- IPv4 address
- ttl
- Time to live (TTL) for the record in seconds
[edit] AAAA record
{
"name": "{domain}",
"type": "AAAA",
"address": "{ipv6_address}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- address
- IPv6 address
- ttl
- Time to live (TTL) for the record in seconds
[edit] NS record
{
"name": "{domain}",
"type": "NS",
"nsdname": "{ns_domain}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- nsdname
- FQDN of the host which should be authoritative for the domain
- ttl
- Time to live (TTL) for the record in seconds
[edit] TXT record
{
"name": "{domain}",
"type": "TXT",
"data": "{data}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- data
- TXT record data
- ttl
- Time to live (TTL) for the record in seconds
[edit] SRV record
{
"name": "{domain}",
"type": "SRV",
"priority": {priority},
"weight": {weight},
"port": {port},
"target": "{target}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- priority
- The priority of this target host
- weight
- Server selection mechanism
- port
- The port on this target host of this service
- target
- The domain name of the target host
- ttl
- Time to live (TTL) for the record in seconds
[edit] MX record
{
"name": "{domain}",
"type": "MX",
"preference": {preference},
"exchange": "{mx_domain}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- preference
- Integer which specifies the preference given to this record among others at the same owner
- exchange
- FQDN which specifies a host willing to act as a mail exchange for the owner name
- ttl
- Time to live (TTL) for the record in seconds
[edit] CNAME record
{
"name": "{name}",
"type": "CNAME",
"cname": "{domain}",
"ttl": 3600
}
- name
- Fully qualified domain name (FQDN) of the record
- cname
- FQDN which specifies the canonical or primary name for the owner
- ttl
- Time to live (TTL) for the record in seconds
[edit] Response
[edit] Status Code
- 201 OK
- Success
- 400 Bad Request
- TTL is below allowed minimum
- 401 Unauthorized
- The server could not verify the credentials from the authorization header.
- 404 Not Found
- The specified zone does not exist.
- 409 Conflict
- Requested record conflicts with existing one.
[edit] Response Header
- Location
- The URI of the new DNS record.
[edit] Examples
[edit] Successful Request
Request
POST /dns/test.com/records
Authorization: Basic {base64_encoded(username:password)}
{
"name": "alt.test.com",
"type": "CNAME",
"cname": "altdomain.com"
}
Response
201 Created Location: https://api.hostway.com/dns/test.com/records/447
[edit] Unauthorized Request
Request
POST /dns/test.com/records
{
"name": "alt.test.com",
"type": "CNAME",
"cname": "altdomain.com"
}
Response
401 Unauthorized
[edit] Attempt to create duplicate record
Request
POST /dns/test.com/records
Authorization: Basic {base64_encoded(username:password)}
{
"name": "alt.test.com",
"type": "CNAME",
"cname": "altdomain.com"
}
Response
409 Conflict
{
"conflict": {"message": "Data conflict", "code": 409, "details": ""}
}
[edit] See also