Atom feed of this document
 
 
 

 4.4.4. Add Records

Verb URI Description
POST /domains/domainId/records Add new record(s) to the specified domain.
[Note]Note

This call returns an asynchronous response, as described in Section 3.5, “Synchronous and Asynchronous Responses”.

Normal Response Code(s): 200, 202

Error Response Code(s): dnsFault (400, 500), serviceUnavailable (503), unauthorized (401), badRequest (400), itemNotFound (404), overLimit (413)

This call adds new record(s) to the specified domain.

[Note]Note

When a domain is created, and no TTL (Time To Live) is specified, a default value of 3600 seconds is used. The domain's TTL value is inherited by the record. When the domain and/or record TTL is supplied by the user, either via a create or update call, the TTL values must be 300 seconds or more.

Table 4.5. Required and Optional Attributes for Add Records
Name Description Required
type Specifies the record type to add. Yes
name Specifies the name for the domain or subdomain. Must be a valid domain name. Yes
data The data field for PTR, A, and AAAA records must be a valid IPv4 or IPv6 IP address Yes
priority Required for MX and SRV records, but forbidden for other record types. If specified, must be an integer from 0 to 65535. For MX and SRV records only
ttl If specified, must be greater than 300. Defaults to the domain TTL if available, or 3600 if no TTL is specified. No
comment If included, its length must be less than or equal to 160 characters. No
[Note]Note

id for the record must not be specified.

 

Example 4.91. Add Records Request: XML

POST https://dns.api.rackspacecloud.com/v1.0/1234/domains/2725233/records
Accept: application/xml
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/xml
Content-Length: 777

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recordsList xmlns:ns2="http://www.w3.org/2005/Atom" xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0">
    <record type="A" name="ftp.example.com" data="192.0.2.8" ttl="5771"/>
    <record type="A" name="example.com" data="192.0.2.17" ttl="86400"/>
    <record type="NS" name="example.com" data="dns1.stabletransit.com" ttl="3600"/>
    <record type="NS" name="example.com" data="dns2.stabletransit.com" ttl="3600"/>
    <record type="MX" name="example.com" data="mail.example.com" ttl="3600" priority="5"/>
    <record type="CNAME" name="www.example.com" data="example.com" ttl="5400" comment="This is a comment on the CNAME record"/>
</recordsList>

 

Example 4.92. Add Records Request: JSON

POST https://dns.api.rackspacecloud.com/v1.0/1234/domains/2725233/records
Accept: application/json
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/json
Content-Length: 725

{
  "records" : [ {
    "ttl" : 5771,
    "name" : "ftp.example.com",
    "type" : "A",
    "data" : "192.0.2.8"
  }, {
    "ttl" : 86400,
    "name" : "example.com",
    "type" : "A",
    "data" : "192.0.2.17"
  }, {
    "ttl" : 3600,
    "name" : "example.com",
    "type" : "NS",
    "data" : "dns1.stabletransit.com"
  }, {
    "ttl" : 3600,
    "name" : "example.com",
    "type" : "NS",
    "data" : "dns2.stabletransit.com"
  }, {
    "ttl" : 3600,
    "name" : "example.com",
    "priority" : 5,
    "type" : "MX",
    "data" : "mail.example.com"
  }, {
    "ttl" : 5400,
    "name" : "www.example.com",
    "type" : "CNAME",
    "comment" : "This is a comment on the CNAME record",
    "data" : "example.com"
  } ]
}

[Note]Note

The following examples show the final successful response for the asynchronous call. Refer to Section 3.5, “Synchronous and Asynchronous Responses” for a description of how the asynchronous call works.

 

Example 4.93. Add Records Response: XML

Status: 202 Accepted
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/xml
Content-Length: 1273

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recordsList totalEntries="6" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0">
    <record id="A-6817754" type="A" name="ftp.example.com" data="192.0.2.8" ttl="5771" updated="2011-05-19T08:07:08-05:00" created="2011-05-18T14:53:09-05:00"/>
    <record id="A-6822994" type="A" name="example.com" data="192.0.2.17" ttl="86400" updated="2011-06-24T01:12:52Z" created="2011-06-24T01:12:52Z"/>
    <record id="NS-6251982" type="NS" name="example.com" data="dns1.stabletransit.com" ttl="3600" updated="2011-06-24T01:12:51Z" created="2011-06-24T01:12:51Z"/>
    <record id="NS-6251983" type="NS" name="example.com" data="dns2.stabletransit.com" ttl="3600" updated="2011-06-24T01:12:51Z" created="2011-06-24T01:12:51Z"/>
    <record id="MX-3151218" type="MX" name="example.com" data="mail.example.com" ttl="3600" priority="5" updated="2011-06-24T01:12:53Z" created="2011-06-24T01:12:53Z"/>
    <record id="CNAME-9778009" type="CNAME" name="www.example.com" data="example.com" ttl="5400" updated="2011-06-24T01:12:54Z" created="2011-06-24T01:12:54Z" comment="This is a comment on the CNAME record"/>
</recordsList>

 

Example 4.94. Add Records Response: JSON

Status: 202 Accepted
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/json
Content-Length: 1474

{
  "records" : [ {
    "ttl" : 5771,
    "updated" : "2011-05-19T13:07:08.000+0000",
    "created" : "2011-05-18T19:53:09.000+0000",
    "name" : "ftp.example.com",
    "id" : "A-6817754",
    "type" : "A",
    "data" : "192.0.2.8"
  }, {
    "ttl" : 86400,
    "updated" : "2011-06-24T01:12:52.000+0000",
    "created" : "2011-06-24T01:12:52.000+0000",
    "name" : "example.com",
    "id" : "A-6822994",
    "type" : "A",
    "data" : "192.0.2.17"
  }, {
    "ttl" : 3600,
    "updated" : "2011-06-24T01:12:51.000+0000",
    "created" : "2011-06-24T01:12:51.000+0000",
    "name" : "example.com",
    "id" : "NS-6251982",
    "type" : "NS",
    "data" : "dns1.stabletransit.com"
  }, {
    "ttl" : 3600,
    "updated" : "2011-06-24T01:12:51.000+0000",
    "created" : "2011-06-24T01:12:51.000+0000",
    "name" : "example.com",
    "id" : "NS-6251983",
    "type" : "NS",
    "data" : "dns2.stabletransit.com"
  }, {
    "ttl" : 3600,
    "updated" : "2011-06-24T01:12:53.000+0000",
    "created" : "2011-06-24T01:12:53.000+0000",
    "name" : "example.com",
    "id" : "MX-3151218",
    "priority" : 5,
    "type" : "MX",
    "data" : "mail.example.com"
  }, {
    "ttl" : 5400,
    "updated" : "2011-06-24T01:12:54.000+0000",
    "created" : "2011-06-24T01:12:54.000+0000",
    "name" : "www.example.com",
    "id" : "CNAME-9778009",
    "type" : "CNAME",
    "comment" : "This is a comment on the CNAME record",
    "data" : "example.com"
  } ],
  "totalEntries" : 6
}



loading table of contents...