# DNS

Base URL `https://pfcloud.pfctek.com/api/v1`. Every call needs `Authorization: Bearer mf_…`. Changes accept an `Idempotency-Key` header. Ids are public ids (UUIDs).

## GET /sites/{site}/dns

**DNS records a site needs**

Scope: `dns:read`

For the domain and each alias: ok (points at the server), create (pfcloud can add it), elsewhere (points at another address; never changed) or manual (no connection manages the domain), with the connection that manages it.

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## POST /sites/{site}/dns

**Create missing DNS records**

Scope: `dns:write`

Adds the missing A records through the team's DNS connection, like "Let pfcloud add the records" on the site page. Records that point elsewhere are never changed. HTTPS follows a few minutes later. Answers created, skipped (elsewhere) and manual names.

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## GET /dns/zones

**Domains pfcloud can manage**

Scope: `dns:read`

Names of the domains the team's DNS connections manage.

## GET /dns/suggestions

**Free subdomains for a new site**

Scope: `dns:read`

| Parameter | In | Description |
| --- | --- | --- |
| `zone` | query | A domain from /dns/zones (required) |
| `repository` | query | Repository URL or name, e.g. acme/shop-api |
| `type` | query | Site type, e.g. laravel, node, static |
| `environment` | query | Environment name, e.g. staging |

