---
title: "One-click DNS setup: a Domain Connect link to the DNS provider of the domain when it supports the Hostingsurge template, otherwise the manual records (with the reason); needs domains:write"
method: GET
path: "/projects/{projectId}/domains/{hostname}/dns-setup"
tags: ["Domains"]
---

# One-click DNS setup: a Domain Connect link to the DNS provider of the domain when it supports the Hostingsurge template, otherwise the manual records (with the reason); needs domains:write

`GET /projects/{projectId}/domains/{hostname}/dns-setup`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}/domains/{hostname}/dns-setup`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `projectId` string, uuid, required
- `hostname` string, required

## Response `200`

Domain Connect apply URL or the manual records

- union: One-click DNS setup (Domain Connect, docs/DOMAIN_CONNECT.md) when the domain's DNS provider supports it, otherwise the manual records.
  - object
    - `mode` 'domain_connect', required
    - `hostname` string, required
    - `provider` object, required
      - `id` string, required
      - `name` string, required
    - `applyUrl` string, required: Domain Connect synchronous apply URL at the DNS provider (signed when the platform has a key)
    - `signed` boolean, required
    - `state` string, required: random value the provider passes back to the redirect URI (?state=); compare it on return
    - `records` object[], required: what the provider will create (names relative to the registrable domain)
      - `type` 'A' | 'AAAA' | 'CNAME' | 'TXT', required
      - `name` string, required
      - `value` string, required
  - object
    - `mode` 'manual', required
    - `hostname` string, required
    - `reason` 'configured' | 'not_configured' | 'no_provider' | 'provider_unsupported' | 'template_unsupported' | 'lookup_failed' | 'unavailable', required
    - `provider` object, nullable, required: the DNS provider when it was discovered (e.g. it supports Domain Connect but not this template yet)
      - `id` string, required
      - `name` string, required
    - `records` object[], required: the records to create at the DNS provider (same as Domain.requiredRecords)
      - `type` 'A' | 'AAAA' | 'CNAME' | 'TXT', required
      - `name` string, required
      - `value` string, required

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
