---
title: "Update a zone's NS records"
method: PUT
path: "/{account}/zones/{zone}/ns_records"
tags: ["zones"]
---

# Update a zone's NS records

`PUT /{account}/zones/{zone}/ns_records`

## Request

- Base URL: `https://api.dnsimple.com/v2`
- URL: `https://api.dnsimple.com/v2/{account}/zones/{zone}/ns_records`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/dnsimple/apis/dnsimple-api/docs/:account/zones/:zone/ns_records/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the zone's NS records

## Path parameters

- `account` integer, required
- `zone` string, required

## Request body

- union
  - object
    - `ns_names` string[], required
    - `ns_set_ids` integer[]
  - object
    - `ns_names` string[]
    - `ns_set_ids` integer[], required

## Response `200`

Successfully updated the zone name servers.

- object
  - `data` ZoneRecord[], required
    - `id` integer, required: The unique identifier for the record.
    - `zone_id` string, required: The unique identifier of the zone this record belongs to
    - `parent_id` integer, nullable, required: Deprecated - the value is always null.
    - `name` string, required: The name of the record (e.g., "www" for www.example.com).
    - `content` string, required: The content/value of the record (e.g., IP address for A records, hostname for CNAME records).
    - `ttl` integer, required: The Time To Live (TTL) value for the entry, in seconds.
    - `priority` integer, nullable, required: The priority value for MX and SRV records. Lower values have higher priority.
    - `type` 'A' | 'AAAA' | 'ALIAS' | 'CAA' | 'CNAME' | 'DNSKEY' | 'DS' | 'HINFO' | 'MX' | 'NAPTR' | 'NS' | 'POOL' | 'PTR' | 'SOA' | 'SPF' | 'SRV' | 'SSHFP' | 'TXT' | 'URL', required: The type of DNS record. Supported DNS record types are listed below. Note that some record types may only be available on specific plans.
    - `regions` ZoneRecordRegion[], required: The regions where this record is active. If empty, the record is active in all regions.
    - `system_record` boolean, required: Returns true if a record is a system generated record and thus is not modifiable.
    - `created_at` string, date-time, required: A date-time value, representing when the entry was created, formatted as ISO 8601.
    - `updated_at` string, date-time, required: A date-time value, representing when the entry was last updated, formatted as ISO 8601.

## Other responses

- `404`: The requested resource doesn't exist.

## Changes

- **2026-09-17** (v2) `faec8b49cc03`: 1 info
  - response property `data/items/parent_id` deprecated
- **2026-09-04** (v2) `426c0bd65e72`: 1 breaking, 1 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - added `subschema #1, subschema #2` to the request body `anyOf` list
- **2025-07-11** (v2) `06780be0ef17`: 1 breaking, 2 warning, 15 info
  - the request's body type changed from `object` to no type
  - removed the request property `ns_names`
  - removed the request property `ns_set_ids`
  - added `subschema #1, subschema #2` to the request body `anyOf` list
  - …14 more
- **2023-07-18** (v2) `c8591dcf8c29`: 18 breaking, 2 info
  - removed `subschema #1, subschema #2` from the request body `anyOf` list
  - the request's body type changed from no type to `object`
  - the response property `data/items/parent_id` became nullable for the status `200`
  - the response property `data/items/priority` became nullable for the status `200`
  - …16 more

[Operation history](https://skmtc.dev/dnsimple/apis/dnsimple-api/changes/:account/zones/:zone/ns_records/put.md)

---

[API](https://skmtc.dev/dnsimple/apis/dnsimple-api.md) - [All operations](https://skmtc.dev/dnsimple/apis/dnsimple-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dnsimple/apis/dnsimple-api/revisions/2d2e7a8fb60a?raw)
