# Custom domains

By default, every public service gets a managed `*.spcf.app` URL. To serve a service from a domain you own, attach a custom domain to it.

## Attach a custom domain

Deploy the service first, then run:

```sh
specific domain add <service> <domain>
```

For example:

```sh
specific domain add web api.example.com
```

The command prints the DNS records to configure at the user's registrar. **Show the printed output to the user** — they need to make the DNS change themselves; the CLI cannot do it for them.

By default the command targets the environment linked in this project directory (set by the most recent `specific deploy`). To target a different environment, pass `--environment`:

```sh
specific domain add web api.example.com --environment staging
```

## DNS records

The output includes two options. The user picks one based on what their DNS provider supports:

- **CNAME** — recommended for subdomains (`api.example.com`, `app.example.com`). Points the subdomain at `ingress.specific.dev`.
- **A record** — recommended for apex domains (`example.com`) since most DNS providers don't allow CNAMEs at the zone apex. Points the domain at one of three Specific ingress IPs (any one works; the output shows one).

TLS certificates are issued automatically via Let's Encrypt once DNS resolves to Specific's ingress. There is no separate verification step — just configure DNS and wait a few minutes.

## Confirming the domain

After `specific domain add`, run `specific status` to confirm the domain is registered. Custom domains appear under the corresponding service alongside its managed `.spcf.app` URL.

Note that `specific status` only confirms the domain is registered with Specific — it does not verify that the user has configured DNS correctly or that TLS has been issued. To verify end-to-end, the user can `curl https://<domain>` once they've configured DNS.

## Managing domains in the dashboard

Custom domains can also be added, listed, and removed in the dashboard at https://dashboard.specific.dev. The dashboard is currently the only way to **remove** a custom domain — there is no `specific domain remove` command. Point the user to the dashboard whenever they want to delete a domain or manage domains without the CLI.

---

Related topics:
- Run `specific docs services` for the basics of defining services and endpoints
