# Domains

This page says how an app answers at a hostname you own. It teaches
`durable-sdk domains add|list|verify|rm`.

Every app answers at `<slug>.durablesdk.com` from its first promotion;
that hostname always stands. A custom domain is added beside it on Pro
and Enterprise; on Free `domains add` is refused `plane.tier.custom_domain`
([Pricing and tiers](https://durablesdk.com/docs/operate/pricing-and-tiers.md)).

## Add

```bash
durable-sdk domains add app.example.com
```

```text
durable-sdk domains: app.example.com added to my-app, pending
  add a TXT record _verify.app.example.com with the value verify=3f9c…
  then run durable-sdk domains verify app.example.com
```

The answer carries the `challenge` (`type`, `name`, `value`): the TXT
record that proves the hostname is yours. It does not yet carry the
record that routes the hostname to the platform. Until it does, route a
subdomain yourself with a CNAME to the app's platform hostname:

```text
CNAME  app.example.com  my-app.durablesdk.com
```

An apex (`example.com`) cannot be routed until the answer carries its
record; add a subdomain for now. One hostname belongs to one app.

## Verify

```bash
durable-sdk domains verify app.example.com
```

The platform reads the record and marks the domain `verified`; TLS is
issued within minutes and renewed by the platform. Until then the
domain reads "not verified yet: add the TXT record shown"; a verified
hostname answers once its CNAME is in place. At
verification the app's `DURABLE_HOSTNAMES` is rewritten so the app's
handlers answer for the new hostname (a request under any other host is
404).

## List and remove

```bash
durable-sdk domains list
durable-sdk domains rm app.example.com
```

```text
HOSTNAME                 KIND       STATUS      VERIFIED AT
my-app.durablesdk.com    platform   verified    2026-10-28T12:04:31Z
app.example.com          custom     pending     —
```

The platform hostname cannot be removed. Removing a custom domain stops
the app answering for it at once; the DNS records are yours to delete.

## Previews and staging

A preview answers at `<slug>-git-<branch>.durablesdk.com` alone; a
custom domain binds the production deployment. Staging's own hostname
(`<slug>-staging.durablesdk.com`) is coming (DS-035).

## The console and a custom domain

The dashboard's Console tab reaches your app through its platform
hostname, never a custom one, and never a hostname taken from a request
([Security](https://durablesdk.com/docs/operate/security.md)).

---

Prompt for an agent:

```text
Read https://durablesdk.com/docs/hosting/domains.md, then point a custom domain at an app on durablesdk.com; run durable-sdk doctor --host before and after; a refused line is a refusal id: durable-sdk explain <id>
```
