You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Tutorial - Add a custom domain to your Azure CDN endpoint | Microsoft Docs
2
+
title: 'Tutorial: Add a custom domain to your endpoint'
3
+
titleSuffix: Azure Content Delivery Network
3
4
description: Use this tutorial to add a custom domain to an Azure Content Delivery Network endpoint so that your domain name is visible in your URL.
4
5
services: cdn
5
-
documentationcenter: ''
6
6
author: asudbring
7
-
manager: danielgi
8
-
editor: ''
9
-
7
+
manager: KumudD
10
8
ms.service: azure-cdn
11
-
ms.workload: media
12
-
ms.tgt_pltfrm: na
13
-
ms.devlang: na
14
9
ms.topic: tutorial
15
-
ms.date: 06/11/2018
10
+
ms.date: 11/06/2020
16
11
ms.author: allensu
17
12
ms.custom: mvc
18
13
# As a website owner, I want to add a custom domain to my CDN endpoint so that my users can use my custom domain to access my content.
19
14
20
15
---
21
-
# Tutorial: Add a custom domain to your Azure CDN endpoint
22
-
This tutorial shows how to add a custom domain to an Azure Content Delivery Network (CDN) endpoint. When you use a CDN endpoint to deliver content, a custom domain is necessary if you would like your own domain name to be visible in your CDN URL. Having a visible domain name can be convenient for your customers and useful for branding purposes.
16
+
# Tutorial: Add a custom domain to your endpoint
17
+
18
+
This tutorial shows how to add a custom domain to an Azure Content Delivery Network (CDN) endpoint.
19
+
20
+
The endpoint name in your CDN profile is a subdomain of azureedge.net. By default when delivering content, the CDN profile domain is included within the URL.
23
21
24
-
After you create a CDN endpoint in your profile, the endpoint name, which is a subdomain of azureedge.net, is included in the URL for delivering CDN content by default (for example, https:\//contoso.azureedge.net/photo.png). For your convenience, Azure CDN provides the option of associating a custom domain with a CDN endpoint. With this option, you deliver your content with a custom domain in your URL instead of an endpoint name (for example, https:\//www.contoso.com/photo.png).
22
+
For example, **https://contoso.azureedge.net/photo.png**.
23
+
24
+
Azure CDN provides the option of associating a custom domain with a CDN endpoint. This option delivers your content with a custom domain in your URL instead of the default domain.
25
25
26
26
In this tutorial, you learn how to:
27
27
> [!div class="checklist"]
@@ -33,76 +33,64 @@ In this tutorial, you learn how to:
33
33
34
34
## Prerequisites
35
35
36
-
Before you can complete the steps in this tutorial, you must first create a CDN profile and at least one CDN endpoint. For more information, see [Quickstart: Create an Azure CDN profile and endpoint](cdn-create-new-endpoint.md).
36
+
* Before you can complete the steps in this tutorial, create a CDN profile and at least one CDN endpoint.
37
+
* For more information, see [Quickstart: Create an Azure CDN profile and endpoint](cdn-create-new-endpoint.md).
37
38
38
-
If you do not already have a custom domain, you must first purchase one with a domain provider. For example, see [Buy a custom domain name](../app-service/manage-custom-dns-buy-domain.md).
39
+
* If you don't have a custom domain, purchase one with a domain provider.
40
+
* For more information, see [Buy a custom domain name](../app-service/manage-custom-dns-buy-domain.md).
39
41
40
-
If you are using Azure to host your [DNS domains](../dns/dns-overview.md), you must delegate the domain provider's domain name system (DNS) to an Azure DNS. For more information, see [Delegate a domain to Azure DNS](../dns/dns-delegate-domain-azure-dns.md). Otherwise, if you are using a domain provider to handle your DNS domain, proceed to [Create a CNAME DNS record](#create-a-cname-dns-record).
42
+
* If you're using Azure to host your [DNS domains](../dns/dns-overview.md), delegate your custom domain to Azure DNS.
43
+
* For more information, see [Delegate a domain to Azure DNS](../dns/dns-delegate-domain-azure-dns.md).
44
+
* If you're using a domain provider to handle your DNS domain, continue to [Create a CNAME DNS record](#create-a-cname-dns-record).
41
45
42
46
43
47
## Create a CNAME DNS record
44
48
45
-
Before you can use a custom domain with an Azure CDN endpoint, you must first create a canonical name (CNAME) record with your domain provider to point to your CDN endpoint. A CNAME record is a type of DNS record that maps a source domain name to a destination domain name. For Azure CDN, the source domain name is your custom domain name and the destination domain name is your CDN endpoint hostname. After Azure CDN verifies the CNAME record that you create, traffic addressed to the source custom domain (such as www\.contoso.com) is routed to the specified destination CDN endpoint hostname (such as contoso.azureedge.net).
49
+
Before you can use a custom domain with an Azure CDN endpoint, you must first create a canonical name (CNAME) record with your domain provider to point to your CDN endpoint.
50
+
51
+
A CNAME record is a DNS record that maps a source domain name to a destination domain name.
52
+
53
+
For Azure CDN, the source domain name is your custom domain name and the destination domain name is your CDN endpoint hostname.
46
54
47
-
A custom domain and its subdomain can be associated with only a single endpoint at a time. However, you can use different subdomains from the same custom domain for different Azure service endpoints by using multiple CNAME records. You can also map a custom domain with different subdomains to the same CDN endpoint.
55
+
Azure CDN routes traffic addressed to the source custom domain to the destination CDN endpoint hostname after it verifies the CNAME record.
56
+
57
+
A custom domain and its subdomain can be associated with a single endpoint at a time. Use multiple CNAME records to use different subdomains from the same custom domain for different Azure service endpoints.
58
+
59
+
You can map a custom domain with different subdomains to the same CDN endpoint.
48
60
49
61
> [!NOTE]
50
-
> Any alias record type can be used for Custom domains if you're using Azure DNS as your domain provider. This walkthrough uses the CNAME record type. If you're using A or AAAA record types, follow the same steps below and replace CNAME with the record type of your choice. If you're using an alias record to add a root domain as a custom domain and you want to enable TLS, you must use manual validation as described in [this article](./cdn-custom-ssl.md?tabs=option-1-default-enable-https-with-a-cdn-managed-certificate#custom-domain-is-not-mapped-to-your-cdn-endpoint). For more information, see [Point zone apex to Azure CDN endpoints](../dns/dns-alias.md#point-zone-apex-to-azure-cdn-endpoints).
62
+
> Any alias record type can be used for custom domains if you're using Azure DNS as your domain provider. This tutorial uses the CNAME record type. If you're using A or AAAA record types, follow the same steps below and replace CNAME with the record type of your choice.
51
63
52
64
## Map the temporary cdnverify subdomain
53
65
54
-
When you map an existing domain that is in production, there are special considerations. While you are registering your custom domain in the Azure portal, a brief period of downtime for the domain can occur. To avoid interruption of web traffic, first map your custom domain to your CDN endpoint hostname with the Azure cdnverify subdomain to create a temporary CNAME mapping. With this method, users can access your domain without interruption while the DNS mapping occurs.
66
+
When you map an existing domain that is in production, there are special considerations. While you're registering your custom domain in the Azure portal, a brief period of downtime for the domain can occur.
55
67
56
-
Otherwise, if you are using your custom domain for the first time and no production traffic is running on it, you can directly map your custom domain to your CDN endpoint. Proceed to [Map the permanent custom domain](#map-the-permanent-custom-domain).
68
+
To avoid interruption of web traffic, map your custom domain to your CDN endpoint hostname with the Azure **cdnverify** subdomain. This process creates a temporary CNAME mapping.
57
69
58
-
To create a CNAME record with the cdnverify subdomain:
70
+
With this method, users can access your domain without interruption while the DNS mapping occurs.
59
71
60
-
1. Sign in to the web site of the domain provider for your custom domain.
72
+
If production downtime considerations aren't a concern, you can directly map your custom domain to your CDN endpoint. Continue to [Map the permanent custom domain](#map-the-permanent-custom-domain).
73
+
74
+
To create a CNAME record with the cdnverify subdomain:
61
75
62
-
2. Find the page for managing DNS records by consulting the provider's documentation or searching for areas of the web site labeled **Domain Name**, **DNS**, or **Name server management**.
76
+
1. Sign in to the web site of the DNS provider for your custom domain.
63
77
64
-
3. Create a CNAME record entry for your custom domain and complete the fields as shown in the following table (field names may vary):
78
+
2. Create a CNAME record entry for your custom domain and complete the fields as shown in the following table (field names may vary):
- Source: Enter your custom domain name, including the cdnverify subdomain, in the following format: cdnverify.<custom domain name>. For example, cdnverify.www.contoso.com.
84
+
- Source: Enter your custom domain name, including the cdnverify subdomain, in the following format: **cdnverify.\<custom-domain-name>**
85
+
- For example: **cdnverify.www.contoso.com**
71
86
72
-
- Type: Enter *CNAME*.
87
+
- Type: Enter or select **CNAME**.
73
88
74
-
- Destination: Enter your CDN endpoint hostname, including the cdnverify subdomain, in the following format: cdnverify._<endpoint name>_.azureedge.net. For example, cdnverify.contoso.azureedge.net.
89
+
- Destination: Enter your CDN endpoint hostname, including the cdnverify subdomain, in the following format: **cdnverify.\<endpoint-name>.azureedge.net**.
90
+
- For example: **cdnverify.contoso.azureedge.net**
75
91
76
92
4. Save your changes.
77
93
78
-
For example, the procedure for the GoDaddy domain registrar is as follows:
79
-
80
-
1. Sign in and select the custom domain you want to use.
81
-
82
-
2. In the Domains section, select **Manage All**, then select **DNS** | **Manage Zones**.
83
-
84
-
3. For **Domain Name**, enter your custom domain, then select **Search**.
85
-
86
-
4. From the **DNS Management** page, select **Add**, then select **CNAME** in the **Type** list.
87
-
88
-
5. Complete the following fields of the CNAME entry:
89
-
90
-

91
-
92
-
- Type: Leave *CNAME* selected.
93
-
94
-
- Host: Enter the subdomain of your custom domain to use, including the cdnverify subdomain name. For example, cdnverify.www.
95
-
96
-
- Points to: Enter the host name of your CDN endpoint, including the cdnverify subdomain name. For example, cdnverify.contoso.azureedge.net.
97
-
98
-
- TTL: Leave *1 Hour* selected.
99
-
100
-
6. Select **Save**.
101
-
102
-
The CNAME entry is added to the DNS records table.
103
-
104
-

105
-
106
94
107
95
## Associate the custom domain with your CDN endpoint
108
96
@@ -112,19 +100,18 @@ After you've registered your custom domain, you can then add it to your CDN endp
112
100
113
101
2. On the **CDN profile** page, select the CDN endpoint to associate with the custom domain.
4.For**Endpoint hostname**, the endpoint host name to use as the destination domain of your CNAME record is prefilled and is derived from your CDN endpoint URL: *<endpointhostname>*.azureedge.net. It cannot be changed.
109
+
4.In**Add a custom domain**, **Endpoint hostname**, is pre-filled and is derived from your CDN endpoint URL: **\<endpoint-hostname>**.azureedge.net. It cannot be changed.
124
110
125
-
5. For **Custom hostname**, enter your custom domain, including the subdomain, to use as the source domain of your CNAME record. For example, www\.contoso.com or cdn.contoso.com. Do not use the cdnverify subdomain name.
111
+
5. For **Custom hostname**, enter your custom domain, including the subdomain, to use as the source domain of your CNAME record.
112
+
1. For example, **www.contoso.com** or **cdn.contoso.com**. **Don't use the cdnverify subdomain name**.
- Source: Enter your custom domain name (for example, www\.contoso.com).
151
+
- Source: Enter your custom domain name.
152
+
- For example: **www.contoso.com**
165
153
166
-
- Type: Enter *CNAME*.
154
+
- Type: Enter or select **CNAME**.
167
155
168
-
- Destination: Enter your CDN endpoint hostname. It must be in the following format:_<endpoint name>_.azureedge.net. For example, contoso.azureedge.net.
156
+
- Destination: Enter your CDN endpoint hostname in the following format: **\<endpoint-name>.azureedge.net**.
157
+
- For example: **contoso.azureedge.net**
169
158
170
159
4. Save your changes.
171
160
172
161
5. If you're previously created a temporary cdnverify subdomain CNAME record, delete it.
173
162
174
163
6. If you are using this custom domain in production for the first time, follow the steps for [Associate the custom domain with your CDN endpoint](#associate-the-custom-domain-with-your-cdn-endpoint) and [Verify the custom domain](#verify-the-custom-domain).
175
164
176
-
For example, the procedure for the GoDaddy domain registrar is as follows:
177
-
178
-
1. Sign in and select the custom domain you want to use.
179
-
180
-
2. In the Domains section, select **Manage All**, then select **DNS** | **Manage Zones**.
181
-
182
-
3. For **Domain Name**, enter your custom domain, then select **Search**.
183
-
184
-
4. From the **DNS Management** page, select **Add**, then select **CNAME** in the **Type** list.
185
-
186
-
5. Complete the fields of the CNAME entry:
187
-
188
-

189
-
190
-
- Type: Leave *CNAME* selected.
191
-
192
-
- Host: Enter the subdomain of your custom domain to use. For example, www or cdn.
193
-
194
-
- Points to: Enter the host name of your CDN endpoint. For example, contoso.azureedge.net.
195
-
196
-
- TTL: Leave *1 Hour* selected.
197
-
198
-
6. Select **Save**.
199
-
200
-
The CNAME entry is added to the DNS records table.
201
-
202
-

203
-
204
-
7. If you have a cdnverify CNAME record, select the pencil icon next to it, then select the trash can icon.
205
-
206
-
8. Select **Delete** to delete the CNAME record.
207
-
208
165
209
166
## Clean up resources
210
167
211
168
In the preceding steps, you added a custom domain to a CDN endpoint. If you no longer want to associate your endpoint with a custom domain, you can remove the custom domain by performing these steps:
212
169
213
170
1. In your CDN profile, select the endpoint with the custom domain that you want to remove.
214
171
215
-
2. From the **Endpoint** page, under Custom domains, right-click the custom domain that you want to remove, then select **Delete** from the context menu.
172
+
2. From the **Endpoint** page, under Custom domains, right-click the custom domain that you want to remove, then select **Delete** from the context menu. Select **Yes**.
216
173
217
174
The custom domain is disassociated from your endpoint.
0 commit comments