Update a DNS record
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Partial update — omitted fields keep their current value. The type
cannot be changed. The same rules as creating apply to the new values
(see POST .../records/); DNS is republished, a proxied change reaches
the edge at once, and on an external-DNS domain the edge check runs
again in the background. Records NSIN manages (editable: false —
gateway records, locked Email Routing records) cannot be changed here.
Requires records.edit.
Path parameters
- domainstringrequiredpath
The domain name (for example
example.com) — not a numeric id. - recordIdintegerrequiredpath
Numeric id of the DNS record.
Request body
Content type: application/json · required
- namestring
- destinationstring
New value — see
destinationon Record. - mx_priorityinteger
MX priority.
MXonly. - ttlinteger
Seconds resolvers may cache this record. Forced to 120 while
proxiedis true — a proxied record answers with our edge addresses, and traffic can only be moved between edges as fast as the slowest resolver still holding the old answer.Default:120 - proxiedboolean
See
proxiedon RecordCreate. - captchaboolean
Challenge visitors before passing them to the origin.
- schemestring
Protocol the edge uses to reach the origin of a proxied record.
Https— TLS toport(443 when the port is unset or out of range).Http— plain HTTP toport(80 when unset or out of range).Auto— HTTPS on 443 first, falling back to plain HTTP. The port is always 443.Default— accepted on input, and so are an empty or unrecognised value, but stored asAutowith port 443: a record never reads back asDefault.
One of:"Http""Https""Auto""Default" - portinteger
See
porton RecordCreate. - host_headerstring
See
host_headeron RecordCreate. An empty string removes the override. - host_header_modestring
See
host_header_modeon RecordCreate.One of:"own""target" - monitorboolean
Include this record in uptime monitoring.
- timeoutinteger
Origin wait before 504, in seconds. Max 1800 (30 minutes).
- commentstring
Free-form note. An empty string removes it.
Responses
200Updated record.
Content type: application/json
- idinteger
- namestring
Record name relative to the domain.
@is the apex. - original_namestring
The fully-qualified name, with trailing dot.
- typestringOne of:
"A""AAAA""CNAME""ANAME""NS""TXT""MX""SRV""PTR""CAA""TLSA""SSHFP""URI" - destinationstring
The record's value. For a proxied record this is the origin the edge connects to, and the published DNS answer is the NSIN proxy IP instead — see
dns_content. - dns_contentstring
What is actually published in DNS. Equals the proxy IP for proxied records.
- ttlinteger
TTL in seconds.
- proxiedboolean
Route this hostname through the NSIN edge. Only
A,AAAA,CNAMEandANAMEmay be proxied. - captchaboolean
Challenge visitors before passing them to the origin.
- editableboolean
False for records NSIN manages on your behalf.
- managed_bystring
The platform feature that owns this record, or empty for a record you created.
email_routingmarks the MX, SPF and DKIM rows Email Routing publishes; they are removed by disabling routing, never through the record endpoints (which refuse them while locked). - user_idinteger
- domain_idinteger
- schemestring
Protocol the edge uses to reach the origin of a proxied record.
Https— TLS toport(443 when the port is unset or out of range).Http— plain HTTP toport(80 when unset or out of range).Auto— HTTPS on 443 first, falling back to plain HTTP. The port is always 443.Default— accepted on input, and so are an empty or unrecognised value, but stored asAutowith port 443: a record never reads back asDefault.
One of:"Http""Https""Auto""Default" - portinteger
Origin port for proxied records: 443 for
Auto, otherwise as set (default 443 forHttps, 80 forHttp). - host_headerstring
Overrides the Host header (and SNI) sent to the origin.
- host_header_modestring
Which name a proxied
CNAME/ANAMEsends to its origin as the Host header (and SNI) whenhost_headeris empty: empty — the record's own hostname (the default);target— the hostname it points at.One of:"""target" - gateway_preset_idinteger | null
The gateway this record was created for, or
nullfor a record you made. A gateway record is not editable here; rename or remove it through the gateway endpoints. - gateway_allowed_hostsstring
Gateway records only: a JSON array, as a string, of the other hostnames the gateway's service links to. The edge serves them under
/_nsin/<host>/on the gateway hostname. - gateway_rewrite_urlsboolean
Gateway records only — whether the edge rewrites URLs in responses to go through the gateway.
- monitorboolean
Include this record in uptime monitoring.
- timeoutinteger
How long an edge node waits for the origin to start responding before returning 504, in seconds. Default 60, maximum 1800 (30 minutes). Only applies to proxied records.
Default:60 - mx_priorityinteger
Only meaningful for
MX. - commentstring
Free-form note.
- created_atstring (date-time)
- updated_atstring (date-time)
- deleted_atstring | null (date-time)
Always
null— deleted records are never returned. - edge_statusstring
External-DNS domains, proxied records only. Whether the name resolves to NSIN's edge, as last checked:
ok— every address it resolves to is ours;miss— it resolves elsewhere, only partly to us, or not at all;error— the first lookup failed and nothing is known yet. Absent until the first check, and always absent on a managed-DNS domain.One of:"ok""miss""error" - edge_viastring
How an
okrecord reaches NSIN: through the CNAME target (cname), by publishing our address directly (a), orproxy— DNS points at another CDN or proxy, but that service forwards to NSIN and the edge is serving the host (judged from the last 24h of request logs). A CNAME keeps working when our addresses change; an A record does not.One of:"cname""a""proxy" - edge_detailstring
What the name actually resolves to, for display.
- edge_checked_atstring (date-time)
{
"id": 0,
"name": "www",
"original_name": "www.example.com.",
"type": "A",
"destination": "string",
"dns_content": "string",
"ttl": 0,
"proxied": true,
"captcha": true,
"editable": true,
"managed_by": "string",
"user_id": 0,
"domain_id": 0,
"scheme": "Http",
"port": 0,
"host_header": "string",
"host_header_mode": "",
"gateway_preset_id": 0,
"gateway_allowed_hosts": "string",
"gateway_rewrite_urls": true,
"monitor": true,
"timeout": 60,
"mx_priority": 0,
"comment": "string",
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"deleted_at": "2026-01-01T00:00:00Z",
"edge_status": "ok",
"edge_via": "cname",
"edge_detail": "string",
"edge_checked_at": "2026-01-01T00:00:00Z"
}400Malformed body or an invalid value (see POST .../records/).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}402Setting host_header on a domain with no active plan.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}403Read-only key, insufficient role, the record is not editable, or a
new host_header on a plan without the Host-header override
feature.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404Domain or record not found.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}409The domain is disabled or banned.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}502The DNS servers refused the write; retry in a moment.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}Example request
curl -X PUT "https://api.nsin.ir/domains/example.com/records/0" \
-H "Authorization: Bearer $NSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"destination": "string",
"mx_priority": 0,
"ttl": 120,
"proxied": true,
"captcha": true,
"scheme": "Http",
"port": 0,
"host_header": "string",
"host_header_mode": "own",
"monitor": true,
"timeout": 0,
"comment": "string"
}'