> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set a custom domain for CDN

export const Caution = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border danger-admonition dark:danger-admonition">
      <div class="mt-0.5 w-4">
        <svg width="14" height="14" viewBox="0 0 14 14" fill="rgb(239, 68, 68)" xmlns="http://www.w3.org/2000/svg" class="w-4 h-4 text-sky-500" aria-label="Danger">
          <path fill-rule="evenodd" clip-rule="evenodd" d="M7 1.3C10.14 1.3 12.7 3.86 12.7 7C12.7 10.14 10.14 12.7 7 12.7C5.48908 12.6974 4.0408 12.096 2.97241 11.0276C1.90403 9.9592 1.30264 8.51092 1.3 7C1.3 3.86 3.86 1.3 7 1.3ZM7 0C3.14 0 0 3.14 0 7C0 10.86 3.14 14 7 14C10.86 14 14 10.86 14 7C14 3.14 10.86 0 7 0ZM8 3H6V8H8V3ZM8 9H6V11H8V9Z"></path>
        </svg>
      </div>
      <div class="text-sm prose min-w-0">
        {children}
      </div>
    </div>;
};

A custom domain is a unique, branded domain name used for content delivery through a CDN. A website at `mywebsite.com` can configure a [CDN resource](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource) for static content with the custom domain `cdn.mywebsite.com`. Static assets are then delivered with URLs like `cdn.mywebsite.com/sample.jpg`.

Any domain or subdomain for which DNS records can be edited is valid as a custom domain. For CNAME-based resources, a third-level domain is typical, e.g. `cdn.mywebsite.com`. For CDN resources using DNS delegation to Gcore, a second-level domain is used, e.g. `mywebsite.com`.

<Caution>
  The custom domain cannot be changed after the CDN resource has been created. To use a different domain, add it as an [additional domain](#specify-additional-domains-only-for-static-cdn-resources). This option is only available for CDN resources for static content, not for CDN resources integrated with entire sites.
</Caution>

## Set a custom domain (for static CDN resources)

The instructions below apply to CNAME-based CDN resources. For CDN resources using DNS delegation to Gcore, the custom domain is set via nameserver change at the domain registrar — CDN resource creation covers both DNS delegation and CNAME-based setup.

1. During CDN resource creation, enter the domain or subdomain name in the **Add domain**\* section. To add multiple custom domains, click **Add CNAME**.

<Warning>
  Multiple custom domains can only be added when creating a CDN resource for static assets. For CDN resources covering an entire site, adding additional custom domains is not supported.
</Warning>

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image2.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=baf646ae92079d504e8396b77dabbfc9" alt="CDN resource creation form — Add domain section" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image2.png" />
</Frame>

2. Click **Create**. The **Resource was created** page appears, showing the CNAME value assigned to the resource (formatted as `cl-XXXX.gcdn.co`) along with step-by-step DNS setup instructions and an example in BIND zone file format.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image3.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=3a7162f575f152c36f53c75d2995706c" alt="Resource was created page showing the assigned CNAME value" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image3.png" />
</Frame>

3. At the DNS provider's website, create a [CNAME record](https://gcore.com/learning/dns-cname-record-explained) for the custom domain pointing to the value shown on the **Resource was created** page:

```
cdn.mywebsite.com. cl-XXXX.gcdn.co
```

Replace `cl-XXXX.gcdn.co` with the value specific to the account.

If multiple custom domains were added in step 1, create CNAME records for all of them.

Verify the record with `dig` or the Gcore [DNS lookup](https://gcore.com/dev-tools/dns-lookup) tool.

## Check the DNS setup status

The Setup guide in resource settings verifies that the DNS configuration was completed successfully and identifies any issues.

1. Open the settings of the CDN resource.

2. Click **Setup guide**.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image4.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=cf48fc6a9a80402c084ecde1f12da351" alt="CDN resource settings with Setup guide button" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image4.png" />
</Frame>

3. A 3-step wizard opens. Navigate to **Check DNS setup status** and click the button to run the DNS check.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image5.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=5479ecd82f3c95422b754d608a81173e" alt="Setup guide wizard showing the Set up your DNS step" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image5.png" />
</Frame>

If the message "DNS record hasn't been set up" appears, check the DNS settings for configuration errors.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image6.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=5f6d0548f8847f007bbf3fea089a5349" alt="Setup guide showing DNS record has not been set up" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image6.png" />
</Frame>

If "DNS record has been successfully set up" appears, the configuration is complete.

To verify the frontend of the integrated website, right-click any static file and select **Inspect**. This shows the content delivery URL from which the file is served.

## Specify additional domains (only for static CDN resources)

Additional custom domains can be added to an existing CDN resource at any time through the resource settings.

1. In the [CDN resource list](https://portal.gcore.com/cdn/resources/list), click the CNAME value of the resource to configure.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image1.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=f3e33f83407e2737c6777f94d377bf59" alt="CDN resource list showing resources with CNAME values" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image1.png" />
</Frame>

2. In the **Custom domain (to create a CNAME record)** section, click **+** and enter the domain name.

<Frame>
  <img src="https://mintcdn.com/gcore-doc-1894/D4afn3gx_zp92kAa/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image7.png?fit=max&auto=format&n=D4afn3gx_zp92kAa&q=85&s=235c38e6ce9078cfa548548820ca90b8" alt="Custom domain section in CDN resource settings with the add button" width="1400" height="900" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn-image7.png" />
</Frame>

3. Click **Save changes** at the bottom of the page.

<Note>
  For each additional domain, create a CNAME record following the [instructions above](#set-a-custom-domain-for-static-cdn-resources).
</Note>

Once the additional domains are set up, the website can deliver different types of static files from separate domains.
