Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
styleh3
pageSuperb Cloud API

POST /dns_zones/:dns_zone_id/records 

Creates a new DNS record

Sections:

Table of Contents
maxLevel4
minLevel2
includeResponse.*|JSON.*|XML.*

Request Parameters

name* - DNS record name

ttl* - the time to live value

type* - the record type

ip* - host IP ( for A and AAAA records)

Response Parameters

returns created DNS record

JSON Request example

Code Block
languagebash
themeRDark
 curl -i -X POST <api_url>/dns_zones/:dns_zone_id/records.json -d '{"dns_record":{"name":"TEST_NAME","ttl":"111","type":"A","ip":"127.1.1.1"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

JSON Response

Code Block
themeRDark
 {
    "dns_record": {
        "id": 1561633,
        "ip": "127.1.1.1",
        "name": "TEST_NAME",
        "ttl": "111",
        "type": "A"
    }
}

XML Request example

Code Block
languagebash
themeRDark
 curl -i-X POST <api_url>/dns_zones/:dns_zone_id/records.xml -d "<dns_record><name>test</name><ttl>111</ttl><type>A</type><ip>127.1.1.1</ip></dns_record>" -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

XML Response example

Code Block
languagexml
themeRDark
 <?xml version="1.0" encoding="UTF-8"?>
<dns_record>
<name>test23</name>
<ttl>111</ttl>
<id type="integer">2696</id>
<type>A</type>
<ip>127.1.1.1</ip>
</dns_record>