# Domains (/docs/compute/domains)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Point a custom domain at a production app and the platform verifies DNS and provisions TLS for you.

Location: Compute > Domains

Configure custom domains that point to your [production app](https://www.prisma.io/docs/compute/branching). You can't configure custom domains for preview apps.

## Before you start [#before-you-start]

You'll need:

* A [linked project](https://www.prisma.io/docs/compute/getting-started).
* A production app with a [promoted, running deployment](https://www.prisma.io/docs/compute/deployments).
* Access to edit DNS records within your DNS provider.

Domain commands target the [production branch](https://www.prisma.io/docs/compute/branching). Pointing them at any other branch fails with [`BRANCH_NOT_DEPLOYABLE`](https://www.prisma.io/docs/compute/cli-reference#error-codes). Every domain subcommand also accepts `--project` and `--branch` flags.

## Add a custom domain [#add-a-custom-domain]

### 1. Add a domain [#1-add-a-domain]

  

#### bun

```bash
bunx @prisma/cli@latest app domain add shop.acme.com --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app domain add shop.acme.com --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app domain add shop.acme.com --app web
```

#### npm

```bash
npx @prisma/cli@latest app domain add shop.acme.com --app web
```

Registration verifies DNS up front. If the **CNAME** record isn't visible yet, the command fails with [`DOMAIN_DNS_NOT_CONFIGURED`](https://www.prisma.io/docs/compute/cli-reference#error-codes) and prints the record name and value for you to create. Re-running `add` for a hostname that's already attached is safe: it shows the existing domain instead of failing.

### 2. Create CNAME Record [#2-create-cname-record]

Add the printed DNS record, which points at `switchboard.{region}.prisma.build`.

Example:

| Type  | Name            | Value                          | TTL |
| ----- | --------------- | ------------------------------ | --- |
| CNAME | `shop.acme.com` | `switchboard.cdg.prisma.build` | 300 |

The CLI prints the record name as the full hostname. If your DNS provider expects a relative name, enter just the label (`shop`).

> [!NOTE]
> What is switchboard?
> 
> Switchboard is the routing layer that sits in front of your Compute app. Switchboard verifies the domain, provisions and terminates TLS, then forwards traffic to your app: one domain, one CNAME, one Compute app.

### 3. Re-run add, then wait for provisioning [#3-re-run-add-then-wait-for-provisioning]

Once the CNAME record has propagated, re-run `app domain add`. This time registration succeeds and TLS provisioning starts. Track it with:

  

#### bun

```bash
bunx @prisma/cli@latest app domain wait shop.acme.com --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app domain wait shop.acme.com --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app domain wait shop.acme.com --app web
```

#### npm

```bash
npx @prisma/cli@latest app domain wait shop.acme.com --app web
```

`wait` polls until the domain is active, up to 15 minutes. For a single status check, use `--timeout 0`:

  

#### bun

```bash
bunx @prisma/cli@latest app domain wait shop.acme.com --app web --timeout 0 --json
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app domain wait shop.acme.com --app web --timeout 0 --json
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app domain wait shop.acme.com --app web --timeout 0 --json
```

#### npm

```bash
npx @prisma/cli@latest app domain wait shop.acme.com --app web --timeout 0 --json
```

A single check exits non-zero with `DOMAIN_VERIFICATION_TIMEOUT` while the domain is still provisioning, so automation should read the status event rather than the exit code. In `--json` mode, `wait` streams newline-delimited status events, so an agent can track provisioning as it progresses.

## Remove a domain [#remove-a-domain]

  

#### bun

```bash
bunx @prisma/cli@latest app domain remove shop.acme.com --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app domain remove shop.acme.com --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app domain remove shop.acme.com --app web
```

#### npm

```bash
npx @prisma/cli@latest app domain remove shop.acme.com --app web
```

Removing detaches the domain from the app; pass `--yes` to skip the confirmation prompt. Prisma can't touch your DNS, so the CNAME record stays behind: delete it at your provider once you no longer need it.

## States [#states]

A domain moves through these states:

| Status             | Meaning                                                         |
| ------------------ | --------------------------------------------------------------- |
| `pending_dns`      | The domain is registered; TLS provisioning hasn't started yet   |
| `provisioning_tls` | The TLS certificate is being issued                             |
| `active`           | The domain is fully provisioned and routing traffic to your app |
| `failed`           | Registration or provisioning failed; see the failure reason     |

## Limits [#limits]

* Custom domains are only available on production apps.
* DNS uses CNAME records only. Apex domains need a DNS provider that supports CNAME-like records (ALIAS, ANAME, or CNAME flattening) at the apex.
* Wildcard hostnames such as `*.acme.com` are rejected.
* Up to 3 custom domains per app; more returns `DOMAIN_QUOTA_EXCEEDED`.
* There's no workspace-wide domain list in the CLI.

## Troubleshooting [#troubleshooting]

  

#### bun

```bash
bunx @prisma/cli@latest app domain show shop.acme.com --app web
bunx @prisma/cli@latest app domain retry shop.acme.com --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app domain show shop.acme.com --app web
pnpm dlx @prisma/cli@latest app domain retry shop.acme.com --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app domain show shop.acme.com --app web
yarn dlx @prisma/cli@latest app domain retry shop.acme.com --app web
```

#### npm

```bash
npx @prisma/cli@latest app domain show shop.acme.com --app web
npx @prisma/cli@latest app domain retry shop.acme.com --app web
```

`show` gives you the exact state, certificate details, and any DNS hints. `retry` restarts stuck provisioning; if a domain isn't in a retryable state, it returns `DOMAIN_RETRY_NOT_ELIGIBLE`.

## Next steps [#next-steps]

* [Deployments](https://www.prisma.io/docs/compute/deployments): promote a deployment to production first.
* [Known limitations](https://www.prisma.io/docs/compute/limitations): what the beta can and can't do.
* [`app domain` reference](https://www.prisma.io/docs/compute/cli-reference#app-domain): every domain subcommand and flag.

## Related pages

- [`@prisma/cli`](https://www.prisma.io/docs/compute/getting-started): Deploy your first app to Prisma Compute with the @prisma/cli beta package, then learn the variations you'll need next.
- [`Branching`](https://www.prisma.io/docs/compute/branching): Branches are isolated environments that map to your Git branches, so preview work never touches production.
- [`CLI reference`](https://www.prisma.io/docs/compute/cli-reference): Every @prisma/cli command, flag, environment variable, and error code for Prisma Compute.
- [`Configuration`](https://www.prisma.io/docs/compute/configuration): Declare your deployable app in a typed prisma.compute.ts file so deploys are reproducible and monorepos work, without re-passing flags every time.
- [`Deployments`](https://www.prisma.io/docs/compute/deployments): Build, deploy, inspect, promote, and roll back app deployments on Prisma Compute.