> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nextdns.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DNS setup and Linked IP

> Read a profile’s DNS server addresses and configure the dynamic DNS hostname for Linked IP.

## Read the setup

`GET /profiles/{profile}/setup` returns the same object as `data.setup` in [Get a profile](https://docs.nextdns.io/api-reference/profiles/get.md). The setup endpoint puts that object directly in `data`.

| Field | Value |
| - | - |
| `ipv4` | Array of IPv4 resolver addresses assigned directly to the profile. May be empty. |
| `ipv6` | The profile’s two IPv6 resolver addresses. |
| `dnscrypt` | A DNS stamp for the profile’s DNS-over-HTTPS endpoint, suitable for use with dnscrypt-proxy. |
| `linkedIp.servers` | The two IPv4 resolver addresses to use with Linked IP. |
| `linkedIp.ip` | The public IPv4 address currently linked to the profile, or `null`. |
| `linkedIp.ddns` | The dynamic DNS hostname for the linked address, or `null`. |
| `linkedIp.updateToken` | The calling account’s Linked IP update token. Redact it before logging or sharing the response. |

To read only the Linked IP settings, use `GET /profiles/{profile}/setup/linkedIp`. Its `data` object contains `servers`, `ip`, `ddns`, and `updateToken` directly. Both reads return `200 OK`.

To update the linked address from a script, open your profile in [My NextDNS](https://my.nextdns.io). Under **Setup → Linked IP**, owners and editors can copy their private `link-ip.nextdns.io` URL from the advanced options. Send a `GET` to that URL from the network you want to link. The token in the URL authenticates the request, and the response body contains the caller’s IP address.

## Set a dynamic DNS hostname

Owners and editors can set `ddns` using either endpoint below. It is the only writable setup field. Send the request over IPv4 from the network you want to link. The first IPv4 address returned for the hostname must match the request’s public IPv4 address.

| Request | JSON body | On success |
| - | - | - |
| `PATCH /profiles/{profile}/setup` | `{"linkedIp":{"ddns":"home.example.net"}}` | `204 No Content`, with an empty body. |
| `PATCH /profiles/{profile}/setup/linkedIp` | `{"ddns":"home.example.net"}` | `200 OK`, with the updated Linked IP object in `data`. |

Replace `home.example.net` with your hostname. Setting the hostname also links its current IPv4 address. Set `ddns` to `null` to clear the hostname and keep the currently linked address.

An IPv6 request to set a hostname returns `400` with `ipv4Only`. If the first IPv4 address differs from the caller’s, the API returns `200` with the error code `different`. Check for an [`errors` array](https://docs.nextdns.io/api-reference/responses#handle-errors) before treating a `200` as success.

Viewers can read setup, including their own update token. Only an owner’s or editor’s token can update the linked address for this profile. A viewer attempting a `PATCH` receives `403` with `insufficientRole`. An authenticated account without access to the profile receives `404`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.