
# Add a domain

![The Domains tab before any custom domain is added: the default kuberns.site URL marked Active, an empty custom-domain list, and the Add Custom Domain button](domains-tab.png "full")

## Add a subdomain

For a hostname such as `api.example.com`:

1. Open **Custom Domains** for the environment.
2. Add the hostname.
3. Copy the CNAME target shown by Kuberns.
4. In your DNS provider, create a CNAME record:

```text
Type:  CNAME
Host:  api
Value: <Kuberns hostname shown in the dashboard>
```

5. Return to Kuberns and wait for DNS verification.

## Add a root domain

For a hostname such as `example.com`:

1. Add the root domain in **Custom Domains**.
2. Kuberns prepares a stable server IP backed by an AWS Elastic IP.
3. Create an A record:

```text
Type:  A
Host:  @
Value: <server IP shown in the dashboard>
```

4. Wait for A-record verification and SSL provisioning.

DNS labels vary by provider. Use the exact target or IP shown in Kuberns.

## Redirect www

The domain flow supports optional `www` redirection. Enable it only after the required host records point to the environment.
