DNS records
Read and change the DNS records of a domain.
These endpoints manage the DNS zone hosted by the registry for your domain. The records are served only while the domain uses the registry's default nameservers. If you point the domain to other nameservers, manage its DNS with that provider instead.
{id} is the domain id from GET /domains/mine. A domain with status pending_profile returns 409 DOMAIN_PENDING_PROFILE.
Record types
| Type | content |
|---|---|
A | IPv4 address, for example 203.0.113.10 |
AAAA | IPv6 address, for example 2001:db8::10 |
CNAME | Target hostname, for example example.com |
MX | Mail server hostname |
MXE | Mail record type specific to the registry's DNS. Use MX unless you know you need it. |
TXT | Text, for example v=spf1 include:_spf.example.net ~all |
SPF | SPF text (most setups publish SPF as TXT instead) |
List records
/domains/{id}/dnscurl https://api.helipod.io/api/domains/42/dns \
-H "Authorization: Bearer hel_your_key"{
"success": true,
"data": [
{ "prefix": "@", "name": "example.com", "type": "A", "content": "203.0.113.10", "ttl": 3600 },
{ "prefix": "www", "name": "www.example.com", "type": "CNAME", "content": "example.com", "ttl": 3600 }
]
}| Field | Description |
|---|---|
prefix | The record name relative to the domain (@ for the domain itself, www, mail, ...). |
name | The full record name. |
type | Record type. |
content | Record value. |
ttl | Time to live in seconds. |
When you write records, the name field takes the prefix (@, www), not the full name.
Set records
/domains/{id}/dnsThis call replaces all existing records with the ones you send. To add one record, read the current list, append the new record and send the full list (using each record's prefix as name).
Prop
Type
curl -X POST https://api.helipod.io/api/domains/42/dns \
-H "Authorization: Bearer hel_your_key" \
-H "Content-Type: application/json" \
-d '{
"records": [
{ "name": "@", "type": "A", "content": "203.0.113.10" },
{ "name": "www", "type": "CNAME", "content": "example.com" },
{ "name": "@", "type": "MX", "content": "mail.example.com", "ttl": 3600 },
{ "name": "@", "type": "TXT", "content": "v=spf1 include:_spf.example.net ~all" }
]
}'{ "success": true, "message": "DNS records created" }If the registry rejects the set (for example a CNAME on a name that already has other records), the response is 422 with code REGISTRAR_REJECTED. Read the records again to see the current state.
Update a record
/domains/{id}/dnsProp
Type
curl -X PUT https://api.helipod.io/api/domains/42/dns \
-H "Authorization: Bearer hel_your_key" \
-H "Content-Type: application/json" \
-d '{ "name": "@", "type": "A", "content": "203.0.113.11", "ttl": 600 }'{ "success": true, "message": "DNS record updated" }Use this for a name that has a single record of the given type. When a name has several records of the same type (for example two MX records), use Set records with the full list instead.
Delete a record
/domains/{id}/dnsThe record to delete goes in the JSON body. name, type and content must match the record exactly.
Prop
Type
curl -X DELETE https://api.helipod.io/api/domains/42/dns \
-H "Authorization: Bearer hel_your_key" \
-H "Content-Type: application/json" \
-d '{ "name": "www", "type": "CNAME", "content": "example.com" }'{ "success": true, "message": "DNS record deleted" }Errors
| Status | code | When |
|---|---|---|
404 | DOMAIN_NOT_FOUND | Unknown or non-numeric domain id, or the domain is not registered at the registry yet. |
409 | DOMAIN_PENDING_PROFILE | The domain waits for owner details. |
422 | VALIDATION_ERROR | Missing field or unsupported record type. |
422 | REGISTRAR_REJECTED | The registry refused the change, for example an invalid record. |
502 | REGISTRAR_ERROR | The registry could not be reached. Retry later. |