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/static-web-apps/custom-domain.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ services: static-web-apps
5
5
author: craigshoemaker
6
6
ms.service: static-web-apps
7
7
ms.topic: conceptual
8
-
ms.date: 02/11/2021
8
+
ms.date: 06/24/2024
9
9
ms.author: cshoe
10
10
---
11
11
12
12
# Custom domains with Azure Static Web Apps
13
13
14
-
By default, Azure Static Web Apps provides an auto-generated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates are automatically created for the auto-generated domain name and any custom domains you may add.
14
+
By default, Azure Static Web Apps provides an autogenerated domain name for your website, but you can point a custom domain to your site. Free SSL/TLS certificates are automatically created for the autogenerated domain name and any custom domains you may add.
15
15
16
-
When you map a custom domain to a static web app, you have a few options available to you. You can configure subdomains and an apex domain.
16
+
When you map a custom domain to a static web app, you have a few options available, which include configuring subdomains and an apex domain.
17
17
18
18
The following table includes links to articles that demonstrate how to configure a custom domain based provider type. <sup>1</sup>
19
19
@@ -29,34 +29,38 @@ The following table includes links to articles that demonstrate how to configure
29
29
30
30
## About domains
31
31
32
-
Setting up an apex domain is a common scenario to configure once your domain name is set up. Creating an apex domain is achieved by configuring an `ALIAS` or `ANAME` record or through `CNAME` flattening. Some domain registrars like GoDaddy and Google don't support these DNS records. If your domain registrar doesn't support all the DNS records you need, consider using [Azure DNS to configure your domain](custom-domain-azure-dns.md).
32
+
Setting up an apex domain is a common scenario to configure once your domain name is set up. Creating an apex domain is achieved by configuring an `ALIAS` or `ANAME` record or through `CNAME` flattening. Some domain registrars like GoDaddy and Squarespace (formerly Google) don't support these DNS records. If your domain registrar doesn't support all the DNS records you need, consider using [Azure DNS to configure your domain](custom-domain-azure-dns.md).
33
33
34
-
Alternatively, for domain registrars that don't support `ALIAS` records, `ANAME` records or `CNAME` flattening, you can configure an `A` record for your static web app. This directs traffic to a single regional host of your static web app. Using `A` records is not recommended as your application will no longer benefit from its global distribution, and this may affect your application performance if your traffic is globally distributed.
34
+
Alternatively, for domain registrars that don't support `ALIAS` records, `ANAME` records or `CNAME` flattening, you can configure an `A` record for your static web app. This configuration directs traffic to a single regional host of your static web app. Using `A` records isn't recommended as your application no longer benefits from global distribution, and this type of setup could affect application performance if your traffic is globally distributed.
35
35
36
-
The following are terms you'll encounter as you set up a custom domain.
36
+
The following are terms you might encounter as you set up a custom domain.
37
37
38
38
***Apex or root domains**: Given the domain `www.example.com`, the `www` prefix is known as the subdomain, while the remaining segment of `example.com` is referred to as the apex domain.
39
39
40
40
***Domain registrar**: A registrar verifies the availability of a domain sells the rights to purchase a domain name.
41
41
42
-
***DNS zone**: A Domain Name System (DNS) zone hosts the DNS records associated to a specific domain. There are various records available which direct traffic for different purposes. For example, the domain `example.com` may contain several DNS records. One record handles traffic for `mail.example.com` (for a mail server), and another `www.contoso.com` (for a website).
42
+
***DNS zone**: A Domain Name System (DNS) zone hosts the DNS records associated to a specific domain. There are various records available which direct traffic for different purposes. For example, the domain `example.com` may contain several DNS records. One record handles traffic for `mail.example.com` (for a mail server), and another `www.example.com` (for a website).
43
43
44
44
***DNS hosting**: A DNS host maintains DNS servers that resolve a domain name to a specific IP address.
45
45
46
46
***Name server**: A name server is responsible for storing the DNS records for a domain.
47
47
48
48
For custom domain verification to work with Static Web Apps, the DNS must be publicly resolvable. After the domain is added, one of the following conditions must be met for automatic certificate renewal to work:
49
-
* Ensure that the public Internet CNAME DNS record used to add the custom domain to the Static Web App via CNAME validation is still present. This option is only valid if CNAME validation was used to add the domain to the static web app.
50
-
* Ensure that the custom domain resolves to the static web app over public internet. This option is valid regardless of the validation method used to add the domain to the web app. This approach is valid even if private endpoints are enabled, because private endpoints for Static Web Apps block internet access to the site contents but do not block internet DNS resolution to the site.
49
+
50
+
* Ensure that the public internet `CNAME` DNS record used to add the custom domain to the Static Web App via `CNAME` validation is still present. This option is only valid if `CNAME` validation was used to add the domain to the static web app.
51
+
52
+
* Ensure that the custom domain resolves to the static web app over public internet. This option is valid regardless of the validation method used to add the domain to the web app. This approach is valid even when you enable private endpoints. The purpose of a private endpoint for Static Web Apps is to block internet access to the site contents, but not to block internet DNS resolution to the site.
51
53
52
54
## Zero downtime migration
53
55
54
-
You may want to migrate a custom domain currently serving a production website to your static web app with zero downtime. DNS providers do not accept multiple records for the same name/host, so you can separately validate your ownership of the domain and route traffic to your web app.
56
+
You may want to migrate a custom domain currently serving a production website to your static web app with zero downtime. DNS providers don't accept multiple records for the same name and host, so you can separately validate your ownership of the domain and route traffic to your web app.
55
57
56
58
1. Open your static web app in the Azure portal.
59
+
57
60
1. Add a **TXT record** for your custom domain (APEX or subdomain). Instead of entering the *Host* value as displayed, enter the *Host* in your DNS provider as follows:
58
61
* For APEX domains, enter `_dnsauth.www.<YOUR-DOMAIN.COM>`.
59
62
* For subdomains, enter `_dnsauth.<SUBDOMAIN>.<YOUR-DOMAIN.COM>`.
63
+
60
64
1. Once your domain is validated, you can migrate your traffic to your static web app by updating your `CNAME`, `ALIAS`, or `A` record to point to your [default host name](./apex-domain-external.md)
0 commit comments