---
schema_version: "1"
id: da44f843cff8e75d84571439c35a315858fec397f6c65f25061b56b0aa72a279
title: Set Up a Custom Domain for Testing in a Sandbox
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/domain_mgmt_sandbox_custom_domains_setup.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_sandbox_custom_domains_setup.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d3e77d00e50c6fbbcc52cd044332986f3cf92012d07507ed8b6992bc9ac400c3
description: Test a new domain before you activate it in production, or test changes to your custom domain or to your sites. Create a custom domain in production that points to your sandbox. That domain serves the Experience Cloud sites or Salesforce Sites in your sandbox with the custom URLs in the sandbox.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Set Up a Custom Domain for Testing in a Sandbox

Test a new domain before you activate it in production, or test changes to your custom domain or to your sites. Create a custom domain in production that points to your sandbox. That domain serves the Experience Cloud sites or Salesforce Sites in your sandbox with the custom URLs in the sandbox.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Applies to: Salesforce Sites and <a href="https://help.salesforce.com/s/articleView?id=experience.exp_cloud_basics_glossary.htm&amp;language=en_US" target="_blank">LWR, Aura, and Visualforce sites</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d140826e78">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">To view a domain:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">
              <p>Manage Custom Domains</p>
              <p>OR</p>
              <p style="margin-bottom:0;">View Setup and Configuration</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">To add a domain:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">
              <p>Manage Custom Domains</p>
              <p>OR</p>
              <p style="margin-bottom:0;">View Setup and Configuration plus either a Site.com Publisher license or Create and Set
                Up Experiences</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">To edit or delete a domain:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">Manage Custom Domains</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">To add, edit, and delete custom URLs:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d140826e78 ">
              <p>Manage Custom Domains</p>
              <p>OR</p>
              <p style="margin-bottom:0;">View Setup and Configuration AND either Create
                and Set Up Experiences OR a Site.com Publisher license</p>
            </td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

Note To test a custom domain in a sandbox, create the domain in production and select the sandbox as the associated org. You can view the domain in your sandbox, but you manage sandbox custom domains in production.

Before you start, review the [considerations](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_sandbox_custom_domains_considerations.htm&release=264.0.0&type=5 "Determine whether you can set up a custom domain in your sandbox, and review considerations for using a content delivery network (CDN) with a custom domain in a sandbox. Learn how to prevent errors when you refresh, clone, or delete a sandbox associated with a custom domain.") for this feature. Then, in your sandbox, create the Experience Cloud sites or Salesforce Sites that you want to serve with the custom domain.

1. Determine the domain configuration option for serving your custom domain. See [Determine How to Serve Your Custom Domain](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_determine_configuration.htm&release=264.0.0&type=5 "To determine the recommended domain configuration option to serve your custom domain, answer a few questions about your domain and your Salesforce configuration.").
2. Complete the [prerequisites](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_update_dns.htm&release=264.0.0&type=5 "Before you add a domain in Salesforce, point your domain to your Salesforce org in Domain Name Service (DNS). If your custom domain uses your HTTPS Certificate or the Salesforce content delivery network (CDN) partner, add a canonical domain name (CNAME) record for your fully qualified domain (FQDN) to DNS. The CNAME record references your Salesforce org ID and your FQDN. Then, if you plan to use the Salesforce CDN to serve your Experience Cloud site on your custom domain, add a second CNAME record that our CDN partner requires.") for a custom domain, including any prerequisites for your chosen domain configuration option.
    
    To test a custom domain that serves content from sites in your production org, use the 18-character org ID for your production org when you update DNS. For more information, see [Point Your Custom Domain to Your Salesforce Org](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_update_dns.htm&release=264.0.0&type=5 "Before you add a domain in Salesforce, point your domain to your Salesforce org in Domain Name Service (DNS). If your custom domain uses your HTTPS Certificate or the Salesforce content delivery network (CDN) partner, add a canonical domain name (CNAME) record for your fully qualified domain (FQDN) to DNS. The CNAME record references your Salesforce org ID and your FQDN. Then, if you plan to use the Salesforce CDN to serve your Experience Cloud site on your custom domain, add a second CNAME record that our CDN partner requires.").
3. In production, create the custom domain that serves site content from your sandbox.
    1. If you have a certificate authority (CA)-signed certificate using Certificate and Key Management for your domain, see [Set Up a Custom Domain That Uses Your HTTPS Certificate](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_cert_setup.htm&release=264.0.0&type=5 "Upload an HTTPS certificate that you own to Salesforce servers, then serve your custom domain with that certificate. After you set up your domain in Salesforce, that domain can serve your Experience Cloud sites or Salesforce Sites.").
    2. To use the Salesforce CDN partner to host an Experience Cloud site on your custom domain, see [Set Up a Custom Domain That Uses the Salesforce CDN](https://help.salesforce.com/s/articleView?id=platform.community_builder_cdn.htm&release=264.0.0&type=5 "You can set up the Salesforce content delivery network (CDN) for your custom domain in Experience Builder, Salesforce Tabs, and Visualforce sites. Within each production environment, you can define multiple domains in a sandbox, but only one custom domain associated with a sandbox org can use the Salesforce CDN.").
        
        In each production environment, only one sandbox custom domain at a time can use the Salesforce content delivery network (CDN). To use the Salesforce CDN in a different sandbox custom domain, update the existing sandbox custom domain that serves an Experience Cloud site via the CDN partner. Specifically, change the domain configuration option or associated org for that domain so that it no longer uses the Salesforce CDN partner in a sandbox.
        
        If you use Marketing Cloud Account Engagement (Pardot) in a Professional Edition org, you must use the Salesforce CDN partner to serve your custom domain.
    3. If your domain is served by a web application firewall (WAF), an external service, or a non-Salesforce service CDN, see [Set Up a Custom Domain That Uses a Third-Party Service or CDN](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_external_host_setup.htm&release=264.0.0&type=5 "Add a domain in Salesforce that’s hosted by a non-Salesforce service or content delivery network (CDN). After you set up your domain in Salesforce, that domain can serve your Experience Cloud sites or Salesforce Sites.").
    4. If your domain already serves content, you can use a temporary non-HTTPS domain to minimize disruption. You can also use a temporary non-HTTPS domain to configure a domain for which your HTTPS certificate isn’t ready. After you configure your custom domain, switch to one of the other supported domain configuration options. See [Use a Temporary Non-HTTPS Domain to Serve Your Custom Domain](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_temp_domain.htm&release=264.0.0&type=5 "Salesforce requires that you serve your custom domain via HTTPS. However, some configuration steps can require a temporary non-HTTPS configuration. If your HTTPS certificate isn’t ready to be uploaded to Salesforce, you can use a temporary domain to start configuring your custom URLs. Also, when your domain serves other content, or when you want to move a custom domain to a new production org, you can use a temporary domain to minimize disruption to your domain.").
    5. For Associated Org, select your sandbox.
        
        The custom domain serves the Experience Cloud sites or Salesforce Sites in the associated org.
4. Save your domain.
    
    After you save your new domain, Salesforce provisions the domain or gets it ready for use. The provisioning process can take 4–14 hours. When that process is complete, the domain’s status on the Domains Setup page changes to Awaiting Activation and you receive an email.
5. To activate your domain, on the Domains Setup page in production, click **Activate** next to your custom domain.
    
    Your site can be unavailable for 5–10 minutes, so activate your custom domain when your site traffic is low. When your site is active, the status changes from Awaiting Activation to Completed and the Current Domain Configuration Option changes to reflect the option that you selected.
6. To serve your sites via your activated domain, log in to the sandbox and [add a custom URL](https://help.salesforce.com/s/articleView?id=platform.custom_url_add.htm&release=264.0.0&type=5 "To specify the site to load when users access your custom domain, add a custom URL. Optionally, you can define additional relationships between your domains and sites by mapping paths for your domain to your sites.").

Your custom domain is ready for testing. After you complete your testing, you can [activate the custom domain in production](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_sandbox_custom_domains_activate.htm&release=264.0.0&type=5 "After you test a custom domain that serves your Experience Cloud sites or Salesforce Sites in a sandbox, move any updates to your sites and the custom URLs for your domain to production. Then activate the custom domain in production.").

#### See Also

- [Custom Domains](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt.htm&release=264.0.0&type=5 "Provide a branded experience for users who access your external-facing Salesforce content by serving your Digital Experiences or Salesforce Sites on a domain that you own, such as https://www.example.com.")
- [Test Your Custom Domains in a Sandbox](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_sandbox_custom_domains.htm&release=264.0.0&type=5 "Develop and test your custom domains that serve content from your Experience Cloud sites and Salesforce Sites in a sandbox before you activate the domain in production.")
- [Experience Cloud](https://help.salesforce.com/s/articleView?id=experience.networks_overview.htm&type=5&language=en_US)
- [Salesforce Sites](https://help.salesforce.com/s/articleView?id=platform.sites_overview.htm&release=264.0.0&type=5 "Salesforce Sites enables you to create public websites and applications that are directly integrated with your Salesforce organization—without requiring users to log in with a username and password. You can publicly expose any information stored in your organization through a branded URL of your choice. And you can make the site's pages match the look and feel of your company’s brand.")