---
schema_version: "1"
id: 6e20d6ef255ffc6d4c3db8756c6fc3cb865c2e2c8dea1f6bc047ad42b5ba7ff6
title: Considerations for Custom Domains in Sandboxes
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_considerations.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_sandbox_custom_domains_considerations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a0460905945eb6c9558d514441fe2c5d120681a6f81cb66b1ef03a25b940bde8
description: 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.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Considerations for Custom Domains in Sandboxes

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.

### 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>

## Feature Exclusions

In each production environment, you can define multiple sandbox custom domains, but only one custom domain associated with a sandbox org can use the Salesforce content delivery network (CDN).

Third-party CDNs are supported only if the CDN configuration meets the [prerequisites](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_enable_https.htm&release=264.0.0&type=5 "If a non-Salesforce service or content delivery network (CDN) serves your domain, complete these steps before you add your domain in Salesforce. To confirm your domain ownership, update your domain’s Domain Name Service (DNS) configuration. Then work with the third-party provider to ensure access to the required HTTP protocols, configure caching and request handling, and review reverse proxy restrictions. If you’re using a third-party CDN, update the header in your CDN to track IP addresses.").

## Sandbox Refreshes from Production

When you refresh a sandbox from its owning production Salesforce org, the custom domain remains associated with the sandbox in a provisioned but inactive state. After you activate the refreshed sandbox, log in and validate the sandbox Salesforce Sites and Experience Cloud sites domains from the Custom URLs Setup page.

## Cloning a Sandbox

You can create a sandbox by cloning an existing sandbox rather than using your production org as the source. When you activate a cloned sandbox, any custom domains associated with the sandbox remain associated with the inactive source sandbox. Until the custom domain is associated with the cloned sandbox again, calls to the custom domain return an error.

To associate your custom domain with the cloned sandbox, after the cloned sandbox is activated, log in to your production org. From the Domains Setup page, edit the custom domain, and change the associated org to an org other than your sandbox. Save your changes, and then activate the domain. Then edit the custom domain again, and update the associated org to your sandbox. Save and activate your domain.

After you reactivate the custom domain for your sandbox, log in to the sandbox and validate the sandbox Salesforce Sites and Experience Cloud sites domains from the Custom URLs Setup page.

## Custom Domains That Point to a Sandbox Experience Builder Site

After you refresh or clone a sandbox, republish your sandbox Experience Builder sites. Calls to a custom domain that points to an Experience Builder site return an error until you publish the site.

## Deleting a Sandbox

Before you delete a sandbox, log in to production and associate any custom domains for that sandbox with a different org. If you don’t update the domain in production, calls to the custom domain URL return an error.

#### 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.")
- [Create, Clone, or Refresh a Sandbox](https://help.salesforce.com/s/articleView?id=platform.data_sandbox_create_parent.htm&type=5&language=en_US)
- [Use a Third-Party Service or CDN to Serve Your Custom Domain](https://help.salesforce.com/s/articleView?id=platform.domain_mgmt_external_host.htm&release=264.0.0&type=5 "Use a domain that’s hosted by a third-party service to serve your Experience Cloud sites or Salesforce Sites. These third-party services include third-party hosts, web application firewalls (WAFs), and non-Salesforce content delivery networks (CDNs).")