---
search:
  tags:
    - sites
    - POST
seo:
  description: >-
    Adds a host of the org's own, like www.example.com or example.com, pending,
    and… Reference for the POST /v1/sites/{site}/domains endpoint in the pols.so
    API.
sidebar:
  label: Add a custom domain to a site
  badge: POST
title: Add a custom domain to a site
type: openapi-operation
---
Adds a host of the org's own, like `www.example.com` or
`example.com`, pending, and checks its DNS at once. The answer's
`records` are what to set at the domain's DNS provider: a `CNAME` to
the site's host for a subdomain, `A` (and optionally `AAAA`) records
to the pols edge for an apex. Once they point to the site, pols
verifies the domain within minutes (`status` `issuing`, then
`active` once the edge has its certificate) and serves the site
there; `POST .../check` checks at once. A host another site already
serves needs the `verification` TXT record as well, which takes it
over. pols re-checks every domain; one whose DNS stops pointing to
pols is `misconfigured` and stops being served after 24 hours.

Custom domains serve public and link sites; a private site cannot
have any yet (409 `conflict`). An org has the host on one of its
sites or published ports at most (409 `conflict`; `move` moves it
here instead). pols' own domains, public suffixes
(`co.uk`), wildcards and IP addresses are refused (400
`bad_request`). An org has at most 20 custom domains and a site 10,
by default (403 `quota_exceeded`), and DNS checks of an org are
rate limited (429 `rate_limited`).

`POST /v1/sites/{site}/domains`
