Skip to main content

Add a custom domain to a CDN resource

  1. Register a domain.
  2. Create a CNAME record in DNS hosting.
  3. Add a custom domain in the control panel.
  4. Add an SSL (TLS) certificate to the CDN resource.
  5. Replace the domain in links on the website.

1. Register a 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 in Selectel.

If you already have a domain, go to step 2.

2. Create a CNAME record in DNS hosting

As a personal domain, you can only use a subdomain of your main domain, for example cdn.example.com for example.com. You cannot use the main domain as a personal one.

  1. Open the resource record editor for the domain:

    • if you have delegated the domain to Selectel, go to the Selectel Control Panel: in the top menu, click Products → DNS Hosting → the Domain zones;
    • if you delegated the domain to a third-party DNS hosting, go to the control panel of this DNS hosting.
  2. Create a resource record. If you delegated the domain to Selectel, use the Add resource record instructions. Specify:

    • record type — CNAME;

    • record name — subdomain like cdn.example.com;

    • value — a default domain like *.selcdn.net. Specify the domain without a protocol, for example cdn.example.com. The allowed length of each domain level is 63 characters. The total length of all levels must not exceed 253 characters.

      You can view the default domain in the Control panel: in the top menu, click Products → CDN → the CDN resources section → the domain will be specified in the CDN resource line.

3. Add a custom domain in the Control Panel

  1. In the control panel, on the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the resource page → General tab.

  3. In the Custom Domain block, click Add Custom Domain.

  4. Enter the custom domain for which you created a CNAME record in step 2. If you have a Cyrillic domain, convert it to Punycode first. For example, for сдн.пример.рф specify xn--d1ask.xn--e1afmkfd.xn--p1ai. You can use any Punycode converter.

  5. Click Apply. While the settings are being applied, the resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The settings will apply when the resource switches to the status ACTIVE.

4. Add a TLS (SSL) certificate to the CDN resource

  1. In the control panel, click Products in the top menu and select CDN.

  2. Go to the CDN Resource Certificates section.

  3. If you want to issue a Let's Encrypt certificate:

    3.1. In the menu, select Issue Let's Encrypt certificate.

    3.2. Select the CDN resource for which you want to issue a certificate.

    3.3. Click Issue.

  4. If you want to upload a custom certificate:

    4.1. In the menu, select Upload custom certificate.

    4.2. Specify the certificate name. The name will only be used in the control panel.

    4.3. Add a certificate for the domain. It must start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----.

    You can add a certificate chain (the domain certificate, intermediate certificates, and root certificate) — ensure they form a complete chain. The Issuer value of the domain certificate must match the Subject value of the first intermediate certificate, the Issuer value of the first intermediate certificate must match the Subject value of the second intermediate certificate, and so on.

    4.4. Add a private key. It must start with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----.

    4.5. Click Upload.

  5. Go to the CDN Resources section.

  6. Open the CDN resource page → Certificates tab.

  7. Select the HTTPS delivery via CNAME checkbox.

  8. In the Certificate field, select the certificate you issued in step 3 or uploaded in step 4.

  9. Click Apply. While the settings are being applied, the resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The settings will be applied when the resource switches to ACTIVE.

If you selected your own origin when creating a CDN resource, replace the domain in the URLs of the website's static files with a custom domain like cdn.example.com, which you specified in step 3 when creating the CNAME record in step 2:

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