Skip to main content

Zone export

Export a zone (Bind)

This endpoint allows you to export your zone file 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/{zonename}

Parameters

NameLocationRequiredTypeDefault valueDescription
zonenameURLYesStringThe zone name
show_updatesURLNoBooleanfalseDisplay record creations, modifications and deletions awaiting validation

Response

A zone file in BIND format

Example Request

GET /dns/v3/zones/example.com
Accept: text/plain

Example Response

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

Export a zone (JSON)

This endpoint allows you to export the content of your zone in JSON format.
You must specify an Accept header to application/json to use this endpoint.

Endpoint

GET /dns/v3/zones/{zonename}

Parameters

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

Response

A ZoneSummary object, or a Zone object 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?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": "454558",
"name": "",
"type": "MX",
"data": "10 mx.perf1.com",
"created_at": "2021-01-01T10:41:27.000000Z",
"modified_at": "2021-01-05T16:48:27.000000Z",
"modified_by": "Frank MICHOT"
},
{
"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"
}
}
]
}
}

Example Response

{
"message": "OK"
}