# Your own domain

Source: https://openpanel.sh/docs/domains/own-domain

Add your own domain to a public service, add the two DNS records it needs, prove the domain is yours, and choose where its HTTPS comes from.

You can give a public service a domain of your own, such as `app.example.com`. The domain needs two DNS records where its DNS is managed: one that sends its traffic to OpenPanel's edge, and one that proves it is yours.

<Callout type="warn" title="Serving own domains is built, not switched on yet">
Adding a domain, its records and the check work today, and prove the domain is yours. OpenPanel's edge serves a verified own domain with a [certificate you upload](/docs/domains/certificates#upload-a-certificate) or [behind Cloudflare](/docs/domains/cloudflare); both open once own domains are switched on. Until then visitors cannot use the domain: use the service's [opnl.app address](/docs/domains/opnl-app) in the meantime.
</Callout>

## Add the domain [#add-the-domain]

The service must be public and have an HTTP port. See [Before you start](/docs/domains#before-you-start).

<Tabs items={["CLI","API"]}>
<Tab value="CLI">
```sh
openpanel domains add app.example.com --project shop --service web
```

```text
Added app.example.com to web.
Add these DNS records where the domain is managed:
TYPE   NAME                        VALUE
CNAME  app.example.com             edge.openpanel.sh
TXT    _openpanel.app.example.com  dOkxu6K2TUOCoUD4EcEmgO86
```
</Tab>

<Tab value="API">
```sh
curl -X POST https://openpanel.sh/api/v1/services/$SERVICE_ID/domains \
  -H "Authorization: Bearer $OPENPANEL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"host": "app.example.com"}'
```

The answer's `records` holds the two records, each with its `type`, `name`, `value` and `purpose`.
</Tab>
</Tabs>

## The DNS records [#the-dns-records]

| Type | Name | Value | Why |
|---|---|---|---|
| **CNAME** | the domain, such as `app.example.com` | `edge.openpanel.sh` | Sends the domain's traffic to OpenPanel's edge. |
| **TXT** | `_openpanel.` and the domain, such as `_openpanel.app.example.com` | the token in the answer | Proves the domain is yours. Each domain gets its own token. |

The token is shown again whenever you list the project's domains, so you do not need to save it.

**Where the CNAME points through.** On Cloudflare, make the CNAME **proxied** and set the zone's SSL/TLS mode to **Full**: Cloudflare's certificate then faces visitors. Anywhere else, keep it as it is and [upload a certificate](/docs/domains/certificates#upload-a-certificate) once the domain is verified. At the root of a domain (`example.com`), use an `ALIAS` or `ANAME` record if your DNS host has one; Cloudflare flattens a `CNAME` there by itself.

**On Cloudflare, OpenPanel can write both records for you**, and verify the domain by itself: see [Domains on Cloudflare](/docs/domains/cloudflare).

## Check the records [#check-the-records]

Once both records are in place, check them. OpenPanel looks up the TXT record at `_openpanel.` and the domain at that moment; when it holds the domain's token, the domain is **verified**: it is yours, and no other organization can add it any more. A new record can take a few minutes to be seen.

<Tabs items={["Console","CLI","API"]}>
<Tab value="Console">
On the **Domains** page, choose **Check DNS** on the domain's row. The records stay open beside it while the domain waits.
</Tab>

<Tab value="CLI">
```sh
openpanel domains verify app.example.com --project shop
```

```text
app.example.com is verified: it is yours.
```

When the record is not there yet, the CLI prints the TXT record to add and exits with 1.
</Tab>

<Tab value="API">
```sh
curl -X POST https://openpanel.sh/api/v1/domains/$DOMAIN_ID/verify \
  -H "Authorization: Bearer $OPENPANEL_TOKEN"
```

The answer is the domain with `verifiedAt` set. When no TXT record holds the token yet, it is `422` with what is missing. From an AI agent, the MCP tool is `domains_verify`.
</Tab>
</Tabs>

Checking needs deploy access to the project, the same as adding the domain.

## Who gets a domain [#who-gets-a-domain]

- **The first proof wins.** Several organizations may add the same domain; the first whose TXT record is checked gets it, and the others' claims stop there.
- **A claim waits 7 days.** A domain not verified within 7 days of being added is removed; add it again to get a new token.
- **OpenPanel's own names** (openpanel.sh and the names under it) cannot be added.

## What works today [#what-works-today]

- **Adding, checking and removing a domain**, in the console, the CLI, the API and MCP.
- **The records**, in the console, and in the CLI's and the API's answers.
- **The domain holds its service and port.** While a service has your own domains it stays public, and it keeps the HTTP port each domain reaches. Remove the domain first to change either.
- **Serving**, with an uploaded certificate or behind Cloudflare, once own domains are switched on. A domain that is not verified, or whose claim ran out, never reaches your service: the edge answers it with its own "Nothing is deployed here" page.

## Remove the domain [#remove-the-domain]

```sh
openpanel domains remove app.example.com --project shop --yes
```

Then delete the two records at your DNS provider if nothing else uses them. Records OpenPanel wrote in a [connected Cloudflare zone](/docs/domains/cloudflare) are deleted by OpenPanel.

<Cards>
<Card href="/docs/domains/opnl-app" title="opnl.app addresses" description="The address that works today, and the naming rules." />

<Card href="/docs/domains/certificates" title="Certificates" description="How HTTPS works for each kind of domain." />
</Cards>