Everything you can do in the web dashboard (adding and deleting domains, managing DNS records) is also available programmatically through a REST API.
Every endpoint accepts and returns JSON. Authentication requires an API key (see below). There is currently no pagination or rate limiting.
https://ns.nrnic.com/api
You can generate an API key from your Account Settings. A newly generated key is shown only once, so make sure to save it somewhere safe.
Include the following Authorization header on every request:
Authorization: Bearer nrnic_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On error, the response uses an appropriate HTTP status code (401/404/409/422/500, etc.) and the following JSON shape.
{
"error": {
"code": "domain_not_found",
"message": "Domain not found."
}
}
| Method | Path | Description |
|---|---|---|
| GET | /api/domains | List the domains owned by the authenticated user |
| POST | /api/domains | Add a domain |
| GET | /api/domains/{id} | Get a domain, including its NS sync and delegation status |
| DELETE | /api/domains/{id} | Delete a domain |
| POST | /api/domains/{id}/resync | Re-push the DNS zone to all nameservers (ns1-ns4) |
| POST | /api/domains/{id}/delegation-check | Check whether the domain has been delegated to NRNIC |
| GET | /api/domains/{id}/records | List a domain's DNS records |
| POST | /api/domains/{id}/records | Add a DNS record |
| PUT | /api/domains/{id}/records/{record_id} | Update a DNS record |
| DELETE | /api/domains/{id}/records/{record_id} | Delete a DNS record |
# List the domains owned by the authenticated usercurl -s https://ns.nrnic.com/api/domains \
-H "Authorization: Bearer nrnic_xxxxxxxx"
# Add a domaincurl -s https://ns.nrnic.com/api/domains \
-H "Authorization: Bearer nrnic_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"fqdn": "example.com"}'
# Delete a domaincurl -s -X DELETE https://ns.nrnic.com/api/domains/123 \
-H "Authorization: Bearer nrnic_xxxxxxxx"
# Add a DNS recordcurl -s https://ns.nrnic.com/api/domains/123/records \
-H "Authorization: Bearer nrnic_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"type": "A", "name": "@", "content": "192.0.2.1", "ttl": 3600}'
# Update a DNS recordcurl -s -X PUT https://ns.nrnic.com/api/domains/123/records/456 \
-H "Authorization: Bearer nrnic_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"type": "A", "name": "@", "content": "192.0.2.2", "ttl": 3600}'
# Delete a DNS recordcurl -s -X DELETE https://ns.nrnic.com/api/domains/123/records/456 \
-H "Authorization: Bearer nrnic_xxxxxxxx"
| type | Record type. One of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA. |
| name | Host name (subdomain part). Use "@" for the zone apex. |
| content | The record's value (an IP address, target host name, etc.). |
| ttl | TTL in seconds, 60-604800. Defaults to 3600 if omitted. |
| priority | Priority for MX/SRV records (0-65535). |
| weight | Weight for SRV records (0-65535). |
| port | Port number for SRV records (0-65535). |