# Static Sites: Custom Domains

Add your own domain to any static site. Custom domains with automatic TLS via Let's Encrypt are included on every plan, including Free.

## Prerequisites

- A deployed static site
- Access to your domain's DNS settings

## Domain limits

| Plan | Custom domains per site |
|------|------------------------|
| **Free** | 2 |
| **Starter** | 10 |
| **Pro** | 50 |

## Adding a custom domain

1. Navigate to your site detail page
2. Click the **Domains** tab
3. Click **Add Domain**
4. Enter your domain (e.g., `www.example.com`)

## Step 1: Verify domain ownership

After adding a domain, you must verify ownership by adding a DNS TXT record at your DNS provider.

### DNS TXT record

| Field | Value |
|-------|-------|
| **Record type** | TXT |
| **Name / Host** | `_danubedata-verify.your-domain.com` |
| **Value** | The verification token shown in the dashboard |
| **TTL** | 300 (or your provider's default) |

Once the record is in place, click **Verify** in the dashboard. DNS propagation typically takes a few minutes but can take up to 24 hours.

### Verification statuses

| Status | Description |
|--------|-------------|
| **Pending** | Awaiting DNS TXT record |
| **Verifying** | DNS lookup in progress |
| **Verified** | Ownership confirmed |
| **Failed** | TXT record not found — check your DNS settings and retry |

## Step 2: Point your domain

After verification, create a DNS record pointing your domain to the static site.

### For subdomains (recommended)

Create a CNAME record:

```
www.example.com  CNAME  {slug}.pages.danubedata.ro
```

### For root domains (apex)

Root domains (`example.com` without `www`) cannot use CNAME records. Depending on your DNS provider:

- **Cloudflare** — Use a CNAME with proxy enabled (flattened automatically)
- **Route53** — Use an ALIAS record
- **Other providers** — Check if your provider supports ALIAS, ANAME, or CNAME flattening

## Step 3: TLS certificate

Once the CNAME (or equivalent) record is active, a TLS certificate is provisioned automatically via Let's Encrypt. This typically takes 1-2 minutes.

### TLS statuses

| Status | Description |
|--------|-------------|
| **Pending** | Awaiting certificate provisioning |
| **Provisioning** | Let's Encrypt certificate being generated |
| **Active** | HTTPS is active with a valid certificate |
| **Failed** | Provisioning failed — ensure your DNS record is correct |

Certificates renew automatically before expiration.

## Setting a primary domain

You can designate any verified domain as the primary domain:

1. Go to the **Domains** tab
2. Click the **Set Primary** button next to the domain

The primary domain is used as the canonical URL for your site.

## Removing a domain

1. Go to the **Domains** tab
2. Click **Delete** next to the domain you want to remove

The domain's routing and TLS certificate are cleaned up automatically.

## Troubleshooting

### Verification keeps failing

- Confirm the TXT record name is exactly `_danubedata-verify.your-domain.com` (not just `_danubedata-verify`)
- Some DNS providers automatically append the domain — in that case, enter only `_danubedata-verify` as the name
- Use a DNS lookup tool to confirm the record is visible: `dig TXT _danubedata-verify.your-domain.com`
- Wait for DNS propagation and retry

### TLS certificate not provisioning

- Ensure the CNAME record is active and resolves correctly
- Check that no CAA records on your domain block Let's Encrypt (`letsencrypt.org`)
- If using Cloudflare, ensure the proxy is enabled or use Full (Strict) SSL mode

### Domain shows a certificate error

- The TLS certificate may still be provisioning — check the TLS status in the dashboard
- Clear your browser cache or try an incognito window
- Verify the CNAME points to the correct `{slug}.pages.danubedata.ro` address

## Next steps

- [Static Sites overview](https://docs.danubedata.ro/static-sites) — Full feature reference
- [Static Sites quick start](https://docs.danubedata.ro/static-sites-quickstart) — Deploy your first site
- [Git deployments](https://docs.danubedata.ro/static-sites-git) — Webhooks and auto-deploy

---

**Questions?** Contact support at support@danubedata.ro
