Skip to main content

Multiple zones export

Export multiple zones (Bind)

This endpoint allows you to export multiple zone files in BIND format.
You must specify an Accept header to text/plain to use this endpoint.
This feature is only available for zones with a primary nameserver managed by Nameshield.
Comment and tags associated with each DNS record will be included at the end of the line in the following format
; [comment] nms_tags=[tags]

Endpoint

GET /dns/v3/zones/export

Parameters

NameLocationRequiredTypeDefault valueDescription
zonenameURLYesArrayThe zone names to export
show_updatesURLNoBooleanfalseDisplay record creations, modifications and deletions awaiting validation

Response

The zone files in BIND format

Example Request

GET /dns/v3/zones/export?zonename[]=example.com&zonename[]=another.com
Accept: text/plain

Example Response

---
; example.com

;
;Zone version: 2019052809
;

$TTL 43200 ; TTL global
example.com. IN SOA ns1.perf1.com. technical.nameshield.net. (
2019052809 ; serial number
28800 ; refresh
7200 ; retry
604800 ; expire
7200 ; minimum TTL
)

$ORIGIN example.com.
;
; Zone NS Records
;

@ NS ns1.perf1.com.
@ NS ns2.perf1.fr.

www A 192.168.0.0
sub1 A 192.168.0.0 ; my comment
sub2 A 192.168.0.0 ; nms_tags=tag1,tag2:"value2"
sub3 A 192.168.0.0 ; my comment nms_tags=tag1,tag2:"value2"

---
; another.com

;
;Zone version: 2023080710
;
$TTL 43200 ; TTL global
another.com. IN SOA ns1.perf1.com. technical.nameshield.net. (
2023080710 ; serial number
28800 ; refresh
7200 ; retry
604800 ; expire
7200 ; minimum TTL
)

$ORIGIN another.com.
;
; Zone NS Records
;

@ NS ns1.perf1.com.
@ NS ns2.perf1.fr.

www A 192.168.12.1
www A 192.168.12.2

Export multiple zones (JSON)

This endpoint allows you to export multiple zone files in JSON format.
You must specify an Accept header to application/json to use this endpoint.

Endpoint

GET /dns/v3/zones/export

Parameters

NameLocationRequiredTypeDefault valueDescription
zonenameURLYesArrayThe zone names
show_updatesURLNoBooleanfalseDisplay record creations, modifications and deletions awaiting validation
show_zone_contentURLNoBooleantrueDisplay zone content (records, soa)

Response

An array of ZoneSummary objects, or an array of Zone objects if the primary nameserver is managed by Nameshield and the show_zone_content parameter is set to true.

Example Request

GET /dns/v3/zones/example.com?zonename[]=example.com&zonename[]=another.com&show_updates=true
Accept: application/json
Body

{
"message": "OK",
"data": [
{
"id": 93219,
"customer_id": 123,
"name": "example.com",
"status": "WAITING_VALIDATION",
"ttl": 43200,
"dnssec_status": "SECURED",
"strategic": true,
"dns_hosting_only": false,
|
"managed_primary_dns": true,
|
"nameservers": [
{
"name": "ns1.perf1.com",
"primary": true
},
{
"name": "ns1.perf1.com",
"primary": false
}
],
"soa": {
"master": "ns1.perf1.com.",
"email": "technical.nameshield.net.",
"serial": "2019052809",
"refresh": 28800,
"retry": 7200,
"expire": 604800,
"minimum": 7200
},
"records": [
{
"name": "",
"type": "NS",
"data": "ns1.perf1.com"
},
{
"name": "",
"type": "NS",
"data": "ns2.perf1.com"
},
{
"id": "454742",
"name": "www",
"type": "A",
"data": "192.168.0.0",
"created_at": "2021-01-01T10:42:21.000000Z",
"modified_at": "2021-01-05T16:48:27.000000Z",
"modified_by": "Yvette COMPIL",
"action": "UPDATED",
"comment": {
"value": "test",
"modified_at": "2021-01-05T16:48:27.000000Z",
"modified_by": "Yvette COMPIL"
}
}
]
},
{
"id": 93220,
"name": "another.com",
"status": "ACTIVE",
"ttl": 43200,
"dnssec_status": "SECURED",
"strategic": true,
"soa": {
"master": "ns1.perf1.com.",
"email": "technical.nameshield.net.",
"serial": "2023080710",
"refresh": 28800,
"retry": 7200,
"expire": 604800,
"minimum": 7200
},
"records": [
{
"name": "",
"type": "NS",
"data": "ns1.perf1.com"
},
{
"name": "",
"type": "NS",
"data": "ns2.perf1.com"
},
{
"id": "454742",
"name": "www",
"type": "A",
"data": "192.168.12.1",
"created_at": "2021-01-01T10:42:21.000000Z",
"modified_at": "2021-01-05T16:48:27.000000Z",
"modified_by": "Yvette COMPIL"
},
{
"id": "454742",
"name": "www",
"type": "A",
"data": "192.168.12.2",
"created_at": "2021-01-01T10:42:21.000000Z",
"modified_at": "2021-01-05T16:48:27.000000Z",
"modified_by": "Yvette COMPIL"
}
]
}
]
}


Example Response

{
"message": "OK"
}