# Manage private nameservers

`POST /v1/domain/@id/reg` · scope `domains:write`

Register, modify or delete private nameservers (glue records) of the domain; choose the operation with `action`:

- `registerNameServer`: register a new glue record (needs `nameserver`, `ip`)
- `modifyNameServer`: change the IP of a glue record (needs `nameserver`, `oldip`, `newip`)
- `deleteNameServer`: delete a glue record (needs `nameserver`)

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/v1/domain/@id/reg` |
| Method | `POST` |
| Scope | `domains:write` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | `application/json` |
| Tokens that can call it | app tokens (`tinoat_`), personal API tokens (`tinopat_`) |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Domain ID |
| `action` | body | string | no | Operation: registerNameServer, modifyNameServer, deleteNameServer |
| `nameserver` | body | string | no | Full nameserver hostname |
| `ip` | body | string | no | IP address for the nameserver – required for registerNameServer |
| `oldip` | body | string | no | Current IP address – required for modifyNameServer |
| `newip` | body | string | no | New IP address – required for modifyNameServer |

## Example request

```bash
curl -X POST "https://api.tino.vn/v1/domain/200001/reg" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "registerNameServer",
  "nameserver": "ns1.example.com",
  "ip": "203.0.113.10",
  "oldip": "203.0.113.10",
  "newip": "203.0.113.11"
}'
```

`$TINO_TOKEN` is a token with the scope `domains:write`. Path parameters in the example are sample values.

SDK ([SDK & examples](/en/docs/sdk)): Python `client.domains.register_nameserver(id, id=...)`, Node.js `await client.domains.registerNameserver(id, { id: ... });`, PHP `$client->domains->registerNameserver($id, ['id' => ...]);`.

## Example response

```json
{
 "info": [
  "0 of 1 events processed",
  "actionsuccess"
 ]
}
```

Live sample from a test account with personal data masked; long arrays and strings are trimmed (`… N more item(s)`, `… N more line(s)`).
