Zone import
Import a zone (Bind)
This endpoint allows you to replace the existing content of the zone.
You must specify a Content-Type header to text/plain to use this endpoint.
The data provided must respect the Bind format. The NS record set at the zone apex, as well as the master and serial fields of the SOA record, will be overwritten by
the values defined by Nameshield.
A comment and tags can be associated with each DNS record.
They must be added at the end of the line in the following format ; [comment] nms_tags=[tags]
Endpoint
PUT /dns/v3/zones/{zonename}
Parameters
| Name | Location | Required | Type | Default value | Description |
|---|---|---|---|---|---|
| zonename | URL | Yes | String | The zone name | |
| update_comment_and_tags | URL | No | Boolean | false | Indicates whether the comments and tags already associated with the dns records should be replaced by those provided as input |
| Body | Yes | Text | The content of the zone file |
Response
A success message
Example Request
PUT /dns/v3/zones/example.com
Content-Type: text/plain
$ORIGIN example.com.
$TTL 86400
example.com. IN SOA ns.example.com. root.example.com (
2019052214 ; serial number
28800 ; refresh
7200 ; retry
604800 ; expire
7200 ; minimum TTL
)
example.com. MX 10 mx.perf1.com.
example.com. A 192.168.1.1
www A 192.168.1.1
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"
Example Response
{
"message": "OK"
}
Import a zone (JSON)
This endpoint allows you to replace the existing content of the zone.
You must specify a Content-Type header to application/json to use this endpoint.
The NS record set at the zone apex, as well as the master and serial fields of the SOA record, can’t be filled.
They will be configured with the values defined by Nameshield.
Endpoint
PUT /dns/v3/zones/{zonename}
Parameters
| Name | Location | Required | Type | Default value | Description |
|---|---|---|---|---|---|
| zonename | URL | Yes | String | The zone name | |
| update_comment_and_tags | URL | No | Boolean | false | Indicates whether the comments and tags already associated with the dns records should be replaced by those provided as input |
| Body | Yes | InputZone | The zone |
Response
A success message
Example Request
PUT /dns/v3/zones/example.com
Content-Type: application/json
{
"ttl": 43200,
"soa": {
"email": "technical@nameshield.net",
"refresh": 28800,
"retry": 7200,
"expire": 604800,
"minimum": 7200
},
"records": [
{
"name": "www",
"type": "A",
"data": "192.168.0.0",
"ttl": 3600
}
]
}
Example Response
{
"message": "OK"
}