Get your free beta license ↗
API operation · dns group
POST

/domains/{name}/dns/records

First published 3 Oct 20260.1.0Unchanged since publication

Add a DNS record to a domain or alias zone

Who may call it
AdministratorResellerCustomer
Token scope, any of
dnsall
Answers201 Created

If zone is omitted or empty, the request targets the domain's own zone. Set zone to an alias name to target its zone. An unrelated zone name returns 404. Targeting a subdomain's own zone returns 400. Use the parent domain in the path to add records to the parent zone.

Set name relative to the zone or use @ for the zone apex. Supported types are A, AAAA, CNAME, MX, TXT, SRV, CAA, and NS. For hostname targets, use a full hostname such as mail.example.com or @ for the zone apex. For SRV, use weight port target in content. For CAA, use flags tag "value". MX and SRV require a priority from 0 to 65535. Set ttl in seconds or omit it to inherit the zone's default. content must contain 1 to 4096 characters and exclude U+0000 through U+001F.

A CNAME requires exclusive use of a name below the zone apex. Only administrators can add reserved records, such as apex NS records or records at or under _acme-challenge. For customer and reseller requests, UrbeStack verifies that the zone still belongs to the domain's customer when it adds the record.

UrbeStack checks its DNS rules and validates the resulting zone with named-checkzone before saving the record. A duplicate returns 409. Other DNS rule or zone validation failures return 400. The 201 response includes the zone name, the saved record, and the publication status.

As a command

Run as root on the server

Parameters

namepath ·DomainNameRequired

Request body

JSON ·DnsRecordCreate· 6 fields
contentstring, up to 4096 charactersRequired
namestring, up to 200 charactersRequired
typestring, one of A, AAAA, CNAME, MX, TXT, SRV, CAA, NSRequired
priorityinteger, 0 to 65535
ttlinteger, 1 to 604800
zonestring, up to 254 characters
Name of a domain alias whose zone should receive the record. Omit this field to add the record to the domain's own zone.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/domains/example.com/dns/records" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "text",
    "name": "alice",
    "priority": 1,
    "ttl": 1,
    "type": "A",
    "zone": "text"
  }'
Response · 201 Created
{
  "published": true,
  "record": {
    "content": "text",
    "created_at": "2026-09-09T10:15:00Z",
    "id": 1,
    "managed_key": "text",
    "name": "alice",
    "origin": "yours",
    "priority": 1,
    "server": true,
    "system": true,
    "ttl": 1,
    "type": "A"
  },
  "reload": "text",
  "zone": "text"
}

Errors

15 errors, each a status and a sentence
400--<o> is required
400<what> must be a number of seconds from 1 to 604800
400Content must be text without control characters, at most 4096 characters
400Domain name required
400Domain name too long
400Invalid domain name
400Invalid record name
400Priority must be a number from 0 to 65535
400Record name required
400Record name too long
400Record type must be one of
400Records for a subdomain live in the zone of <parent>
401Authentication required
404<name> is neither this domain nor one of its other names
404Zone '<name>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-domains-name-dns-records/