# Custom domains

The built-in hostname is `WORKSPACE-ID.aloha.leilani.dev`. To add a custom hostname:

1.  Add the hostname and its destination port to `http.binds`.
2.  At your DNS provider, create a CNAME record pointing that hostname to your workspace’s built-in hostname.
3.  Commit and push the configuration. Allow time for DNS propagation and certificate issuance, then visit the custom hostname over HTTPS.

```text
app.example.com.  CNAME  WORKSPACE-ID.aloha.leilani.dev.
```

Both DNS and configuration are required: the current CNAME chain selects the workspace, and that workspace must explicitly bind the custom hostname. Pointing only an A or AAAA record at Leilani is insufficient. Use a subdomain if your provider flattens apex aliases into address records; Leilani needs a visible CNAME chain.

Leilani obtains and renews certificates automatically using Let’s Encrypt HTTP-01 validation. DNS must resolve to Leilani, and public HTTP on port 80 must reach its challenge handler. A DNS proxy or redirect that intercepts the challenge can prevent issuance. HTTPS becomes available once the certificate is issued.

Add each hostname separately, including `www` if needed. To protect the same paths on multiple hostnames, include all of them in the relevant rule’s `hosts` array.
