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

# Wildcard domains

> Serve every subdomain of a domain from one VPS with *.example.com, and add an _acme-challenge CNAME when StackShift handles HTTPS.

## Goal

Route every subdomain to one server, for example for a panel such as Coolify or a multi-tenant app.

## Prerequisites

* A running VPS.
* Access to the DNS settings of the domain.

## Workflow

**Step 1**

In Networking, choose Add a domain and enter \*.example.com.

**Step 2**

Choose the HTTPS option.

**Step 3**

Add the TXT record on \_stackshift-verify.example.com, and A and AAAA records for \*.example.com.

**Step 4**

If StackShift handles HTTPS, also add the CNAME record \_acme-challenge.example.com pointing at \_acme-challenge.\<name>.compute.stackshift.cloud.

**Step 5**

Choose Check again until both TXT and CNAME show Found.

## Why the CNAME

A wildcard certificate can only be issued with a DNS challenge. The CNAME lets StackShift answer that challenge and get one certificate for every subdomain. It is only needed for a wildcard with StackShift handling HTTPS. With Forward HTTPS untouched, your own server gets its certificates.

The wildcard goes live when both the TXT record and the CNAME are verified.

## Matching

* A wildcard matches one level: a.example.com matches \*.example.com, while a.b.example.com does not.
* A domain you add exactly, such as api.example.com, can point at a different server from the wildcard.
* Every VPS also has \*.\<name>.compute.stackshift.cloud. Use it as the wildcard domain in Coolify, Dokploy or CapRover when you have no domain of your own yet.

## Expected result

> [!TIP]
>
> Any one-level subdomain such as shop.example.com reaches the server over HTTPS.

## Related guides

> [card] [Domains and HTTPS](https://docs.stackshift.cloud/compute/custom-domains.md)
>
> Point your own domain at a VPS, prove it with a TXT record, and choose per domain whether StackShift handles HTTPS or forwards it untouched.

> [card] [Use a VPS with Coolify or Dokploy](https://docs.stackshift.cloud/compute/coolify-and-dokploy.md)
>
> Install Coolify or Dokploy at order time, forward HTTPS untouched to its proxy, and use the server’s wildcard name or your own domains for apps.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.