Zone NS Records API
This article describes a feature in Public Beta.
During the beta period, changes to the individual endpoints may occur at any time. Consider using our official clients to reduce the likelihood of breaking changes. If you are using or planning to use this endpoint we'd like to hear your feedback.
Update zone NS records
PUT /:account/zones/:zone/ns_records
Update the NS records for a zone in a hosted domain in the account.
If vanity name servers are enabled for the domain, please ensure that they are included in the name server name parameters or referenced name server sets, for the vanity name server configuration to stay effective.
Parameters
Name | Type | Description |
---|---|---|
:account |
integer |
The account id |
:zone |
string , integer
|
The zone name or id |
Example
This example assumes that name server set #1 includes ns1.foo.bar
and ns2.foo.bar
.
Update the NS records for the zone example.com
in the account 1010
:
curl -H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X PUT \
-d '{
"ns_names": ["ns1.example.com", "ns2.example.com"],
"ns_set_ids": [1]
}' \
https://api.dnsimple.com/v2/1010/zones/example.com/ns_records
Input
Name | Type | Description |
---|---|---|
ns_names |
array |
A list of name server names as strings. |
ns_set_ids |
array |
A list of name server set IDs. |
Response
Responds with HTTP 200, including the zone’s NS records as defined in our OpenAPI documentation.
{
"data": [
{
"id": 1927,
"zone_id": "example.com",
"parent_id": null,
"name": "",
"content": "ns1.example.com",
"ttl": 3600,
"priority": null,
"type": "NS",
"regions": [
"global"
],
"system_record": true,
"created_at": "2022-11-23T18:05:39Z",
"updated_at": "2022-11-23T18:05:39Z"
},
{
"id": 1928,
"zone_id": "example.com",
"parent_id": null,
"name": "",
"content": "ns2.example.com",
"ttl": 3600,
"priority": null,
"type": "NS",
"regions": [
"global"
],
"system_record": true,
"created_at": "2022-11-23T18:05:39Z",
"updated_at": "2022-11-23T18:05:39Z"
},
{
"id": 1929,
"zone_id": "example.com",
"parent_id": null,
"name": "",
"content": "ns1.foo.bar",
"ttl": 3600,
"priority": null,
"type": "NS",
"regions": [
"global"
],
"system_record": true,
"created_at": "2022-11-23T18:05:39Z",
"updated_at": "2022-11-23T18:05:39Z"
},
{
"id": 1930,
"zone_id": "example.com",
"parent_id": null,
"name": "",
"content": "ns2.foo.bar",
"ttl": 3600,
"priority": null,
"type": "NS",
"regions": [
"global"
],
"system_record": true,
"created_at": "2022-11-23T18:05:39Z",
"updated_at": "2022-11-23T18:05:39Z"
}
]
}
Errors
Responds with HTTP 400 if the NS records cannot be set for the zone.
Responds with HTTP 401 in case of authentication issues.
Responds with HTTP 402 if the account has outstanding payments.
Responds with HTTP 404 if the zone or name server sets are not in the account.
Responds with HTTP 412 if the account doesn’t have access to the name server sets feature.