Create a Domain Record
- Name
post
- Type
- /v1/domains/:name/records
- Description
Send a
POST
request to creata a domain record.
Request
Required Attributes
- Name
type
- Type
- string
- Description
Type of the DNS record
- Name
data
- Type
- string
- Description
Associated data for each DNS type: A: Host address; AAAA: IPv6 host address; ALIAS: Auto resolved alias; CNAME: Canonical name for an alias; MX: Mail eXchange; NS: Name Server; PTR: Pointer; SOA: Start Of Authority; SRV: location of service; TXT: Descriptive text.
Required for
A
,AAAA
,CNAME
,MX
,TXT
,SRV
,NS
type of records.
- Name
name
- Type
- string
- Description
Domain Record name which defines: service name, alias or host name.
Required for
A
,AAAA
,CNAME
,TXT
,SRV
type of records.
- Name
port
- Type
- integer
- Description
Port number for SRV record only, other record types return null.
Required for
SRV
type of records.
- Name
weight
- Type
- integer
- Description
Weight of SRV record only, other record types return null.
Required for
SRV
type of records.
- Name
priority
- Type
- integer
- Description
The priority level for MX and SRV records only, other record types return null.
Required for
MX
,SRV
type of records.
Example
curl -X POST "https://api.simplystack.com/v1/domains/example.com/records" \
-H "Content-Type: application/json" \
-H "Authorization: Token d359ad9cc9422b5ff07aede0cd2707da4ff82be0" \
-d '{"name": "www", "type": "A", "data": "192.168.1.1"}'
Response
JSON object with key named record
which is an array of the following attributes for each domain name record. Attributes that are not applicable for the record type will be set to null
. An id
attribute is generated for each record as part of the object.
Attributes
Example
{
"record": {
"id": 4,
"name": "www",
"data": "192.168.1.1",
"port": null,
"priority": null,
"ttl": 1800,
"type": "A",
"weight": null
}
}