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
Copy file name to clipboardExpand all lines: articles/dns/dns-web-sites-custom-domain.md
+58-67Lines changed: 58 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ services: dns
5
5
author: asudbring
6
6
ms.service: azure-dns
7
7
ms.topic: tutorial
8
-
ms.date: 08/03/2025
8
+
ms.date: 08/04/2025
9
9
ms.author: allensu
10
10
ms.custom: devx-track-azurepowershell
11
11
#Customer intent: As an experienced network administrator, I want to create DNS records in Azure DNS, so I can host a web app in a custom domain.
@@ -117,8 +117,14 @@ az webapp show \
117
117
118
118
# [Portal](#tab/azure-portal)
119
119
120
-
1. Navigate to your DNS zone in the Azure portal.
121
-
1. Select **+ Record set**.
120
+
1. In the search box at the top of the portal, enter **DNS zones**, and select it from the results.
121
+
122
+
1. Select your DNS zone from the list.
123
+
124
+
1. Select **+ Record sets** at the top of the **Overview** page of your DNS zone.
125
+
126
+
1. Select **+ Add**.
127
+
122
128
1. On the **Add record set** page, enter the following information:
123
129
124
130
| Setting | Value |
@@ -129,7 +135,7 @@ az webapp show \
129
135
|**TTL unit**|**Seconds**|
130
136
|**IP address**| Enter the IP address of your web app (copied from the previous step) |
131
137
132
-
1. Select **OK** to create the record.
138
+
1. Select **Add** to create the record.
133
139
134
140
# [PowerShell](#tab/azure-powershell)
135
141
@@ -177,12 +183,18 @@ az network dns record-set a add-record \
177
183
App Services uses this record only at configuration time to verify that you own the custom domain. You can delete this TXT record after your custom domain is validated and configured in App Service.
178
184
179
185
> [!NOTE]
180
-
> If you want to verify the domain name, but not route production traffic to the web app, you only need to specify the TXT record for the verification step. Verification does not require an A or CNAME record in addition to the TXT record.
186
+
> If you want to verify the domain name, but not route production traffic to the web app, you only need to specify the TXT record for the verification step. Verification does not require an A or CNAME record in addition to the TXT record.
181
187
182
188
# [Portal](#tab/azure-portal)
183
189
184
-
1. Navigate to your DNS zone in the Azure portal.
185
-
1. Select **+ Record set**.
190
+
1. In the search box at the top of the portal, enter **DNS zones**, and select it from the results.
191
+
192
+
1. Select your DNS zone from the list.
193
+
194
+
1. Select **+ Record sets** at the top of the **Overview** page of your DNS zone.
195
+
196
+
1. Select **+ Add**.
197
+
186
198
1. On the **Add record set** page, enter the following information:
187
199
188
200
| Setting | Value |
@@ -193,7 +205,7 @@ App Services uses this record only at configuration time to verify that you own
193
205
|**TTL unit**|**Seconds**|
194
206
|**Value**| Enter your web app's default domain name (for example, **contoso.azurewebsites.net**) |
195
207
196
-
1. Select **OK** to create the record.
208
+
1. Select **Add** to create the record.
197
209
198
210
# [PowerShell](#tab/azure-powershell)
199
211
@@ -231,8 +243,14 @@ If your domain is already managed by Azure DNS (see [DNS domain delegation](dns-
231
243
232
244
# [Portal](#tab/azure-portal)
233
245
234
-
1. Navigate to your DNS zone in the Azure portal.
235
-
1. Select **+ Record set**.
246
+
1. In the search box at the top of the portal, enter **DNS zones**, and select it from the results.
247
+
248
+
1. Select your DNS zone from the list.
249
+
250
+
1. Select **+ Record sets** at the top of the **Overview** page of your DNS zone.
251
+
252
+
1. Select **+ Add**.
253
+
236
254
1. On the **Add record set** page, enter the following information:
237
255
238
256
| Setting | Value |
@@ -243,7 +261,7 @@ If your domain is already managed by Azure DNS (see [DNS domain delegation](dns-
243
261
|**TTL unit**|**Seconds**|
244
262
|**Alias**| Enter your web app's default domain name (for example, **contoso.azurewebsites.net**) |
245
263
246
-
1. Select **OK** to create the record.
264
+
1. Select **Add** to create the record.
247
265
248
266
# [PowerShell](#tab/azure-powershell)
249
267
@@ -259,35 +277,16 @@ $cnameRecordParams = @{
259
277
New-AzDnsRecordSet @cnameRecordParams
260
278
```
261
279
262
-
The following example is the response:
263
-
264
-
```
265
-
Name : www
266
-
ZoneName : contoso.com
267
-
ResourceGroupName : myazureresourcegroup
268
-
Ttl : 600
269
-
Etag : 8baceeb9-4c2c-4608-a22c-229923ee185
270
-
RecordType : CNAME
271
-
Records : {contoso.azurewebsites.net}
272
-
Tags : {}
273
-
```
274
-
275
280
# [Azure CLI](#tab/azure-cli)
276
281
277
282
```azurecli
278
-
# Create the CNAME record set
279
-
az network dns record-set cname create \
280
-
--resource-group test-rg \
281
-
--zone-name contoso.com \
282
-
--name "www" \
283
-
--ttl 600
284
-
285
-
# Add the CNAME record
286
-
az network dns record-set cname add-record \
283
+
# Create the CNAME record
284
+
az network dns record-set cname set-record \
287
285
--resource-group test-rg \
288
286
--zone-name contoso.com \
289
287
--record-set-name "www" \
290
-
--cname "contoso.azurewebsites.net"
288
+
--cname "contoso.azurewebsites.net" \
289
+
--ttl 600
291
290
```
292
291
293
292
---
@@ -334,17 +333,36 @@ contoso.com text =
334
333
335
334
## Add custom host names
336
335
337
-
Now, you can add the custom host names to your web app:
336
+
Add the custom host names to your web app:
338
337
339
338
# [Portal](#tab/azure-portal)
340
339
341
-
1. Navigate to your web app in the Azure portal.
342
-
1. In the left navigation under **Settings**, select **Custom domains**.
340
+
1. In the search box at the top of the portal, enter **App Services**, and select it from the results.
341
+
342
+
1. Select your web app from the list.
343
+
344
+
1. Expand **Settings** in the left navigation, then select **Custom domains**.
345
+
343
346
1. Select **+ Add custom domain**.
344
-
1. In the **Custom domain** field, enter your domain name (for example, **contoso.com** or **www.contoso.com**).
347
+
348
+
1. In **+ Add custom domain** dialog, enter the following information:
349
+
350
+
| Setting | Value |
351
+
|---------|-------|
352
+
| Domain provider | Select **All other services**|
353
+
| TLS/SSL certificate | Select **None** (you can add a TLS/SSL certificate later) |
354
+
| TLS/SSL type | Select **SNI SSL**|
355
+
| Domain | Enter your domain name (for example, **contoso.com**) |
356
+
357
+
The domain validation will see the records you created in the previous steps.
358
+
345
359
1. Select **Validate**. Azure will validate that the DNS records you created are properly configured.
346
-
1. If validation is successful, select **Add custom domain**.
347
-
1. Repeat steps 3-6 for each custom domain you want to add (both **contoso.com** and **www.contoso.com**).
360
+
361
+
1. Select **Add**.
362
+
363
+
1. The domain you added is now listed in the **Custom domains** section.
364
+
365
+
1. Repeat steps 3-8 for each custom domain you want to add (both **contoso.com** and **www.contoso.com**).
348
366
349
367
# [PowerShell](#tab/azure-powershell)
350
368
@@ -385,33 +403,6 @@ You should see the same page for both URLs. For example:
385
403
386
404
:::image type="content" source="./media/dns-web-sites-custom-domain/contoso-web-app.png" alt-text="Screenshot of the contoso Azure App Service Web App accessed via web browser.":::
387
405
388
-
## Clean up resources
389
-
390
-
When no longer needed, you can delete all resources created in this tutorial by deleting the resource group **test-rg**:
391
-
392
-
# [Portal](#tab/azure-portal)
393
-
394
-
1. On the Azure portal menu, select **Resource groups**.
395
-
1. Select the **test-rg** resource group.
396
-
1. On the **Overview** page, select **Delete resource group**.
0 commit comments