> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pre.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom domains

> Connect a hostname to a deployed, public pre.dev app.

A custom domain requires an existing deployment and **Public preview access** enabled in **Share**. The current interface supports one custom domain per project.

<Steps>
  <Step title="Add the hostname">
    In the project's Share controls, open **Custom Domain** and enter a hostname such as `app.example.com`. Copy the exact DNS target shown after adding it.
  </Step>

  <Step title="Configure DNS">
    At your DNS provider, add the record shown in the interface. For a subdomain, this is normally a CNAME:

    | Type  | Host                                                  | Target                            |
    | ----- | ----------------------------------------------------- | --------------------------------- |
    | CNAME | `app` or `app.example.com`, as your provider requires | The exact target shown by pre.dev |

    Use a hostname as the target, without an `https://` prefix or a path. For an apex domain, follow your provider's supported alias or flattening configuration and the records shown by pre.dev.
  </Step>

  <Step title="Verify the connection">
    Return to pre.dev and click **Verify Connection**. Once verification and hostname setup succeed, the domain becomes active. Allow time for DNS and certificate provisioning before checking HTTPS.
  </Step>

  <Step title="Check the application">
    Open the domain and exercise key flows. Review allowed origins, login callback URLs, cookies, and any provider configuration that depends on the hostname. The agent can help update application settings after domain activation.
  </Step>
</Steps>

## Troubleshooting

| Symptom                               | What to check                                                                                   |
| ------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Cannot add a domain                   | The project has a deployment, preview is public, and no domain is already configured            |
| DNS verification fails                | The hostname resolves to the exact target shown; the DNS change may still be propagating        |
| Verify is unavailable                 | Wait for the current operation indicated by the interface                                       |
| HTTPS is not ready                    | Check hostname status and certificate provisioning; do not repeatedly remove a valid DNS record |
| App loads but login or API calls fail | Check callback URLs, allowed origins, cookies, and runtime configuration                        |

Use the domain's remove control to detach it. Remove the corresponding DNS record at your provider when it is no longer needed. The original deployment URL remains the fallback hosting address.
