---
title: "Set nameservers for a domain"
method: PUT
path: "/api/domains/{domain}/nameservers"
tags: ["DNS"]
---

# Set nameservers for a domain

`PUT /api/domains/{domain}/nameservers`

## Request

- Base URL: `https://domani.run`
- URL: `https://domani.run/api/domains/{domain}/nameservers`
- Auth: HTTP bearer

Replace the nameservers for a domain you own. Requires 2-13 valid hostnames. Common values: OpenSRS DNS (ns1.systemdns.com, ns2.systemdns.com, ns3.systemdns.com). Nameservers decide where all of the domain's mail goes, sign-in codes included: changing them needs the `email:auth_secrets` scope and a token not confined to mailboxes (403 INSUFFICIENT_SCOPE or 403 MAILBOX_CONFINED otherwise), and every change is recorded in the audit log.

## Path parameters

- `domain` string, required

## Request body

- object
  - `nameservers` string[], required: Nameserver hostnames (2-13 required)

## Response `200`

Nameservers updated successfully

- object
  - `success` boolean
  - `domain` string
  - `nameservers` string[]
  - `hint` string

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `403`: Moving the domain's mail needs the email:auth_secrets scope (INSUFFICIENT_SCOPE) and a token not confined to mailboxes (MAILBOX_CONFINED)
- `404`: Domain not found
- `429`: Rate limit exceeded - wait and retry

---

[API](https://skmtc.dev/domani/apis/domani-run-api.md) · [All operations](https://skmtc.dev/domani/apis/domani-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domani/apis/domani-run-api/revisions/7679f8159533?raw)
