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

# Create and set a custom domain for the content delivery via 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>;
};

## What is a custom domain?

A custom domain is a unique, branded domain name used for content delivery through a CDN. For example, if you have a website with the domain mywebsite.com, you create a CDN resource for static content delivery and specify a custom domain for it, such as cdn.mywebsite.com. This way, your static assets will be delivered to end users with URLs like cdn.mywebsite.com/sample.jpg.

When specifying a custom domain, you can use any domain or subdomain for which you can edit the DNS records. Usually, for [CDN resources intended to deliver static assets](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource-for-only-static-files), our customers use a third-level domain based on their website domain, e.g. cdn.mywebsite.com. For [CDN resources integrated with the entire site](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource-for-the-entire-site)—second-level domains, e.g., *mywebsite.com*.

<Caution>
  **Caution**

  You cannot change the custom domain once the CDN resource has been created. If you need to change domains, use [additional (multiple) domains](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn#specify-additional-domain). This option is only available for CDN resources for static content, not for CDN resources integrated with the entire sites.
</Caution>

## Set a custom domain (only for static CDN recources)

The instructions below describe how to set up a custom domain for static CDN resources with the addition of a CNAME record. Setting up a custom domain for CDN resources integrated with the entire site is different and involves delegating the domain to Gcore's NS servers. Check out the article to learn more: [Create a CDN resource for the entire site](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource-for-the-entire-site#create-and-integrate-a-cdn-resource-for-the-entire-site).

1\. When [creating a CDN resource](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource-for-only-static-files), enter your desired domain or subdomain name in the **Custom domain** section. Specify additional domains by clicking the **+** icon.

<Warning>
  **Warning**

  You can only add additional (multiple) custom domains if you are creating a CDN resource for static assets. If you are creating a CDN resource for the entire site, adding additional custom domains is not possible.
</Warning>

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865716431377.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=02beafbf84461c41992e161b2cf8ef44" alt="Custom domain" width="3168" height="876" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865716431377.png" />
</Frame>

2\. Copy the value *cl-\*\*\*\*.gcdn.co* (which is unique for every account and the same for all custom domains of your account) from the **Set up your DNS** page. Click **Confirm**.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865779424017.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=60834d43067dcda616610747b402bc75" alt="Copy the value" width="3288" height="1656" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865779424017.png" />
</Frame>

3\. Go to your DNS provider's website and create a [CNAME record](https://gcore.com/learning/dns-cname-record-explained) for the custom domain with the value in the previous step. The CNAME record should be specified as follows:

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

Replace *cl-\*\*\*\*.gcdn.co* with the value specific to your account.

If you specified multiple custom domains in step 1, add CNAME records for all additional custom domains.

Use the `dig` command in the terminal or an [online dig tool](https://gcore.com/dev-tools/dns-lookup) to check the record. If the record was added correctly, you will receive a response similar to the one specified above.

4\. Complete the CDN resource creation. You will see the following pop-up window when all configurations are completed:

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865856535057.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=2ef5e7550814700774776cce5653eef3" alt="Complete the CDN resource creation" width="2140" height="848" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865856535057.png" />
</Frame>

## Check the DNS setup status

Our setup guide will verify that the configuration was completed successfully and identify any issues requiring resolution.

1\. Open the settings of the CDN resource that you created.

2\. Click **Setup guide**.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865899219729.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=7045551a3ed518e980a69442cd76142d" alt="Setup guide" width="2656" height="3376" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865899219729.png" />
</Frame>

3\. A checklist will open, displaying each step of the configuration process. A check mark indicates that the step was successful. If any stage lacks a check mark, click on the step and follow the instructions to complete the configuration. When you're done, click **Check DNS setup status**.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865917904145.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=22376b2611d14e8d71645a35e5b7b38f" alt="Setup Status" width="3076" height="3188" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865917904145.png" />
</Frame>

If you see the message "DNS record hasn't been set up", check your Managed DNS settings for configuration errors.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865924935057.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=8965ded653faf3811d9225f890c7e165" alt="check the DNS" width="2840" height="668" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865924935057.png" />
</Frame>

If you see the message "DNS record has been successfully set up", the configuration has been completed correctly.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865958946065.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=5f66f98688a248e2935b7bd68c9a8b6a" alt="completed correctly" width="2264" height="436" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12865958946065.png" />
</Frame>

To check the frontend of your integrated website, right-click on any static files and choose **Inspect**. This will show you the content delivery URL where your file is served.

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

1\. Go to the [CDN resource list](https://cdn.gcore.com/resources/list) and click on the custom domain of the resource you want to configure.

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/cdn-resource-name.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=7461d616cf6c374b574921bb4ab68181" alt="CDN resource list " width="3368" height="1112" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/cdn-resource-name.png" />
</Frame>

2\. In the **Custom domain** section, click the plus sign (+) next to the **Domain** field and enter your desired domain name(s).

<Frame>
  <img src="https://mintcdn.com/gcore/IMOO0N-g2iuoAuyj/images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12866081938961.png?fit=max&auto=format&n=IMOO0N-g2iuoAuyj&q=85&s=6283ca74520e3e1ec4f8144879978ab5" alt="Custom domain" width="4880" height="2180" data-path="images/docs/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn/12866081938961.png" />
</Frame>

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

<Note>
  **Note**

  Add a CNAME record to your DNS following the [instructions above](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn#set-a-custom-domain) for each additional domain.
</Note>

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