# Đổi nameserver

`PUT /v1/domain/@id/ns` · quyền `domains:write`

Đổi nameserver của tên miền; để trống `nameservers` thì dùng nameserver mặc định.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/ns` |
| Method | `PUT` |
| Quyền (scope) | `domains:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Token gọi được | token ứng dụng (`tinoat_`), token API cá nhân (`tinopat_`) |

## Tham số

| Tên | Vị trí | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- | --- |
| `id` | đường dẫn | string | có | ID tên miền |
| `nameservers` | body | array | không | List of nameservers to use |

## Example request

```bash
curl -X PUT "https://api.tino.vn/v1/domain/200001/ns" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "nameservers": "<nameservers>"
}'
```

`$TINO_TOKEN` là token có quyền `domains:write`. Tham số đường dẫn trong ví dụ là giá trị mẫu.

SDK ([SDK & Ví dụ](/docs/sdk)): Python `client.domains.update_nameservers(id, id=...)`, Node.js `await client.domains.updateNameservers(id, { id: ... });`, PHP `$client->domains->updateNameservers($id, ['id' => ...]);`.

## Example response

```json
{
 "success": true,
 "info": [
  "success_changes_save"
 ]
}
```

Mẫu thật từ tài khoản thử, đã che dữ liệu cá nhân; mảng và chuỗi dài được rút gọn (`… N more item(s)`, `… N more line(s)`).
