Create DNS record
POST /dns/rrOperation ID: AddRecord
Create a new DNS record and automatically detect the zone based on the fqdn specified in the name parameter.
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
name | fqdn | yes | Fully Qualified Domain Name (FQDN, ending with a period). |
type | type | no | - |
ttl | ttl | no | Time To Live in seconds (60-86400) |
annotation | string | no | A custom note for this particular record. |
Plus the fields of one of these variants:
| Variant | Fields |
|---|---|
A | data: ipv4 |
AAAA | data: ipv6 |
CNAME | data: fqdn |
CAA | flags: integer, tag: string, data: string |
ALIAS | data: fqdn |
MX | data: fqdn, priority: integer |
TXT | data: string |
Responses
Section titled “Responses”| Status | Type | Description |
|---|---|---|
200 | recordResponse | The record created, with its new ID |
400 | Error | Invalid request |
401 | Error | Unauthorized |
404 | Error | No matching DNS zone found |
417 | Error | DNS record creation violates a zone constraint |
429 | Error | Rate limit for ACME platform credentials (scope acme-dns-challenge): calls per minute, and distinct customers per day. Ordinary customer keys never receive this status on this endpoint. |
500 | Error | Unexpected error |
Response body
Section titled “Response body”| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes | Success indicator |
code | integer | no | Response/Error Code |
response | recordResponse | no | - |
Example
Section titled “Example”curl -X POST "https://api.regfish.com/dns/rr" \ -H "x-api-key: $REGFISH_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "www", "type": "A", "ttl": 600, "annotation": "string", "data": "12.12.12.12" }'Build a request
Section titled “Build a request”Fill in values - the call below updates as you type. Nothing is sent: the API does not currently allow browser requests from this domain (CORS). The API key is not stored.