---
title: "Add a custom domain to a CDN resource"
sidebar_label: "Add a custom domain"
description: "How to add a custom domain to a CDN resource"
sidebar_position: 5
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import AddCnameInDnsHosting from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-cname-in-dns-hosting.mdx'
import AddPersonalDomainToControlPanel from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-personal-domain-to-control-panel.mdx'
import AddSslCertificate from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-ssl-certificate.mdx'

# Add a custom domain to a CDN resource

1. [Register a domain](#register-domain).
2. [Create a CNAME record in DNS hosting](#add-cname-in-dns-hosting).
3. [Add a custom domain in the Control Panel](#add-personal-domain-to-control-panel).
4. [Add a TLS(SSL) certificate to the CDN resource](#add-ssl-certificate).
5. [Replace the domain in links on the website](#change-domain-in-links-on-website).

## 1. Register a domain \{#register-domain}

If you do not yet have a domain that you want to use as a custom one, register it. You can [register a domain](/domains/register-domain.mdx) in Selectel.

If you already have a domain, proceed to [step 2](#add-cname-in-dns-hosting).

## 2. Create a CNAME record in DNS hosting \{#add-cname-in-dns-hosting}

<AddCnameInDnsHosting />

## 3. Add a custom domain in the Control Panel \{#add-personal-domain-to-control-panel}

<AddPersonalDomainToControlPanel />

## 4. Add a TLS (SSL) certificate to the CDN resource \{#add-ssl-certificate}

<AddSslCertificate />

## 5. Replace the domain in links on the website \{#change-domain-in-links-on-website}

If you chose your own content origin when [creating a CDN resource](/cdn/create-resource.mdx), replace the domain in the URLs of your website's static files with the custom domain of the form `cdn.example.com`, which you specified in step 3 when [creating a CNAME record in step 2](#add-cname-in-dns-hosting):

If your website is on a CMS, use a plugin to replace the URLs; otherwise, replace the URLs in the website code.

<Formbricks />
