# POST /dns/clients/{address}/key

First published 21 Oct 2026 (release 0.2.13) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the dns group.

Replace a DNS client's key

- Who may call it: administrator
- Token scope, any of: dns, all
- Answers: 201 Created

Use the existing client's IPv4 address in the path. The old key stops working immediately. The 201 response includes the client and the new key, which is returned only once. Enter the key in the Distribution nodes tab of the DNS zones section in the client server's web interface.

The DNS distribution node handling the request must have a valid license and a web interface hostname. If it has no licensed IP address on record, run urbestack-license-check first.

A node that has already joined uses its original key when calling any node in the network. To replace an unused node invitation, add the node again.

## As a command

- [urbestack-dns-client-key](https://urbestack.com/docs/commands/urbestack-dns-client-key.md): Replaces only the key for an existing DNS client, for example if the key was lost.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/dns/clients/{address}/key" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 201 Created:

```
{
  "client": {
    "address": "info@example.com",
    "also_nameservers": [
      "text"
    ],
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": "text",
    "created_on": "text",
    "disconnected_at": "text",
    "hostname": "server.example.com",
    "ipv4": "text",
    "ipv6": "text",
    "joined_at": "text",
    "joining_as": "text",
    "label": "my laptop",
    "last_error": "text",
    "last_seen_at": "text",
    "nameserver": "text",
    "node": true,
    "port": 8443,
    "zones": 1
  },
  "key": "panel.port"
}
```

## Errors

- 400: --address is required
- 400: Invalid IPv4 address
- 401: Authentication required
- 409: <c.address> is a node of this network. Its key is the one it joined with and cannot be replaced
