NRNIC API

Everything you can do in the web dashboard (adding and deleting domains, managing DNS records) is also available programmatically through a REST API.

Overview

Every endpoint accepts and returns JSON. Authentication requires an API key (see below). There is currently no pagination or rate limiting.

Base URL

https://ns.nrnic.com/api

Authentication

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

Security notes

Treat your API key like a password. Never commit it to a public repository or embed it in client-side JavaScript — use it only from server-side code. If a key is ever exposed, revoke it immediately from your account settings and generate a new one.

Error responses

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."
  }
}

Endpoints

Method Path Description
GET/api/domainsList the domains owned by the authenticated user
POST/api/domainsAdd 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}/resyncRe-push the DNS zone to all nameservers (ns1-ns4)
POST/api/domains/{id}/delegation-checkCheck whether the domain has been delegated to NRNIC
GET/api/domains/{id}/recordsList a domain's DNS records
POST/api/domains/{id}/recordsAdd 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

Examples

Domains

# 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"

DNS records

# 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"

DNS record fields

typeRecord type. One of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
nameHost name (subdomain part). Use "@" for the zone apex.
contentThe record's value (an IP address, target host name, etc.).
ttlTTL in seconds, 60-604800. Defaults to 3600 if omitted.
priorityPriority for MX/SRV records (0-65535).
weightWeight for SRV records (0-65535).
portPort number for SRV records (0-65535).