# Custom domain

On the Ultra plan, serve the CDN's files from a subdomain of the city's, like media.yourcity.com, with HTTPS.

Source: https://fivedash.fivex.gg/docs/en/cdn/custom-domain

With a custom domain, the CDN serves files at the city's address, like `https://media.yourcity.com/itens/agua.png`, instead of `https://cdn.fivex.sh/example-city/itens/agua.png`. It's the city's sign on the warehouse gate. This page shows the exact steps the panel shows. It's for whoever handles the CDN and has access to the city domain's DNS.

## Before you start

* **Ultra plan:** the CDN custom domain is part of Ultra (1 domain). On other plans, the field shows "Available on the Ultra plan." and stays locked.
* **A subdomain:** use a subdomain just for the CDN, like `media.yourcity.com`.
* **DNS access:** you need to create records at the domain's DNS provider (where the domain was bought or where its DNS is managed).
* **Access level:** **Settings** (CDN) at **Configure**.

## Set up the domain

### Open the section

Go to **CDN → Settings** and scroll to **Custom domain**.

### Enter the subdomain

In **Subdomain** ("Enter the address you want to use. Then we'll show the DNS records it needs."), type the address, for example `media.yourcity.com`, and click **Set up domain**. **Domain set up** shows and the **Pending** badge appears.

### Create the CNAME record

The panel shows: "At your domain's DNS provider, add the record below to point this subdomain to the CDN." At the DNS provider, create the record with the values in the table (use the copy buttons next to each value).

### Create the validation records

Under **Validation records**, the panel lists TXT records. Create all of them. "Every value below must be in DNS. When a name repeats, keep a separate TXT record for each value."

### Check the DNS

After saving the records at the provider, click **Check DNS**. **Status checked** shows and the steps update.

### Wait for Active

When both the **Domain** and the **HTTPS certificate** are confirmed, the badge changes to **Active** and you see "DNS and certificate confirmed."

### The CNAME record

| **Type** | **Name / Host**                                  | **Value / Target**                             |
| -------- | ------------------------------------------------ | ---------------------------------------------- |
| `CNAME`  | Your subdomain, for example `media.yourcity.com` | The target shown in the panel (`cdn.fivex.sh`) |

### The validation records

| **Type** | **Name / Host**             | **Value / Target**           |
| -------- | --------------------------- | ---------------------------- |
| `TXT`    | The name shown in the panel | The value shown in the panel |

Copy name and value exactly as the panel shows them. There may be more than one TXT with the same name and different values: create one record for each value.

> At the provider, **Name** may also show up as **Host**, and **Value** as **Target**. If the provider fills in the domain automatically, don't repeat it in the **Name** field. For example, for `media.yourcity.com` at a provider that adds `yourcity.com`, type just `media`.

## Activation steps

The panel shows two steps, each with its own status.

| Step                  | Possible statuses                                       |
| --------------------- | ------------------------------------------------------- |
| **Domain**            | **Validating**, **Confirmed**                           |
| **HTTPS certificate** | **Validating**, **Issuing**, **Activating**, **Active** |

| Message                                                                        | What it means                                    |
| ------------------------------------------------------------------------------ | ------------------------------------------------ |
| "Waiting for the domain and the HTTPS certificate to be validated."            | Nothing confirmed yet. Check the records.        |
| "The domain was confirmed. The HTTPS certificate still needs to be validated." | The CNAME is right; the certificate is missing.  |
| "The certificate was confirmed. The domain still needs to be validated."       | The certificate is right; the domain is missing. |
| "Waiting for the HTTPS certificate to be issued."                              | The certificate is being issued.                 |
| "The certificate was issued. Waiting for it to activate."                      | Almost there.                                    |
| "Domain and HTTPS certificate confirmed."                                      | All done: the badge shows **Active**.            |

## Once it's active

* Links copied in the panel start using the domain: `https://media.yourcity.com/<folder>/<file>` (without the CDN address in the path).
* "Keep the records below at your domain's DNS provider." If you delete the records, the domain stops working.
* Scripts already using `https://cdn.fivex.sh/<address>/…` links keep the default address. Update the scripts if you want to use the domain.

## Remove the domain

### Remove it

In **Custom domain**, click **Remove domain**.

### Check the result

**Domain removed** shows up. If removal still depends on the provider, you see "Domain deactivated. Removal at the provider will be retried automatically." and the badge shows **Removal pending** ("Removal will be retried automatically. You can also try now."). Use **Try to finish removal** to try again.

With the domain deactivated, the files are still available at the CDN's default address. You can delete the records in your DNS afterwards.

## FAQ

**I got "A custom CDN domain is part of the Ultra plan."**
The organization isn't on Ultra. Change plans in **Settings → Plan**.

**I created the records and it's still Pending.**
DNS changes can take a while to apply. Check that the name wasn't doubled (for example, `media.yourcity.com.yourcity.com`) and that every validation TXT is there. Then click **Check DNS** again.

**Can I use the same domain as the store or the rules website?**
Use a different subdomain for the CDN, like `media.yourcity.com`, separate from `store.` and `rules.`.

## Next steps

[CDN](https://fivedash.fivex.gg/docs/en/cdn/overview)How the CDN works.
[Usage and limits](https://fivedash.fivex.gg/docs/en/cdn/usage-and-limits)What each plan includes.
[Upload files](https://fivedash.fivex.gg/docs/en/cdn/upload-files)Copy the new links.
[Plans and billing](https://fivedash.fivex.gg/docs/en/getting-started/plans-and-billing)Move to Ultra.
