---
url: 'https://docs.smoxy.eu/organization/add-a-new-domain.md'
---
# Add a new domain

In smoxy Hub 2.0 you don't add domains directly. A domain appears automatically once you add a matching **hostname** to a zone - smoxy derives the domain from the hostnames you configure.

## Recommended order: main domain first

We recommend configuring your main domain before its subdomains. When the main domain is set up, smoxy issues a wildcard SSL certificate that also covers subdomains you add later, so those subdomains don't need a separate certificate.

For example, set up `example.com` first, then add `stage.example.com` and other subdomains afterwards.

Routing test traffic through smoxy for a single subdomain is no problem. smoxy only starts serving traffic for a hostname once you point it at smoxy with a CNAME record - issuing the certificate on its own doesn't redirect any traffic.

## How to add a domain

1. **Add a hostname to a zone.** Open the [Hostnames](/zones/hostnames) page of the zone and add the hostname you want to serve. smoxy derives the domain from that hostname.
2. **Issue the SSL certificate.** Manage certificates on the [SSL Certificates](/ssl-and-certificates/how-ssl-works) page. smoxy requests the certificate for the hostname, and a wildcard for the main domain where applicable.
3. **Activate the hostname.** Add the CNAME record smoxy shows you to your DNS configuration. Once it resolves to smoxy, the hostname is verified and traffic is served through smoxy.

::: info
If you are using Cloudflare, the Cloudflare proxy for this CNAME record must be disabled. For details, see [Cloudflare Setup](/developer-guide/cloudflare-setup).
:::
