Export the zone as a BIND master file
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Renders the domain's records as a standard BIND zone file, served as a
download (text/plain, Content-Disposition: attachment).
For a proxied record the file carries the origin the edge connects
to, not the NSIN proxy IP that public DNS answers with — the export is
the zone as you configured it, so it stays usable if you restore it
anywhere else. Proxy state is noted out of band, in a trailing
; nsin-proxied:true comment. An apex alias (ANAME) is written as a
CNAME plus an ; nsin-aname:true comment, because ANAME is not a
real DNS type and stops most parsers. A row whose rdata is not valid
presentation form is emitted as a ; SKIPPED comment rather than
dropped silently.
Re-importing the file restores both: POST .../records/import/parse
reads nsin-proxied:true (as well as Cloudflare's cf-proxied:true)
and previews an apex CNAME as the ANAME it came from.
The SOA is synthesized — PowerDNS owns the live one — and its serial
is derived from the records' last-modified time, so exporting unchanged
data twice produces a byte-identical file. The NS set is written only
while NSIN is authoritative for the domain; for a domain on external DNS
the file carries no delegation, so it will not point the zone back at us
if you feed it to another provider.
Record comments are never included. Read-only: requires domain.view,
and unlike the write endpoints it stays available while the domain is
suspended or expired.
Path parameters
- domainstringrequiredpath
The domain name (for example
example.com) — not a numeric id.
Responses
200Zone file.
Content type: text/plain
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"
}403The key is read-only, your role on the domain lacks the required permission, or the domain's plan does not include the feature.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
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"
}Example request
curl -X GET "https://api.nsin.ir/domains/example.com/records/export" \
-H "Authorization: Bearer $NSIN_API_KEY"