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/apex-domain-external.md
+80-4Lines changed: 80 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,21 +13,24 @@ ms.author: cshoe
13
13
14
14
Domain names without a subdomain are known as apex or root domains. For example, the domain `www.example.com` is the `www` subdomain joined with the `example.com` apex domain.
15
15
16
-
Some domain registrars (like Google and GoDaddy) don't allow you to point the apex domain to an existing URL. If your registrar doesn't support `ALIAS` or `ANAME` records, or doesn't allow `CNAME` flattening, then you can't point your apex domain to the generated URL for your static web app.
17
-
18
-
If your registrar doesn't allow you to redirect the apex domain, consider the following options:
16
+
Some domain registrars (like Google and GoDaddy) don't allow you to point the apex domain to an existing URL. If your registrar doesn't support `ALIAS` or `ANAME` records, or doesn't allow `CNAME` flattening, consider the following options:
19
17
20
18
* Configure your domain with [Azure DNS](custom-domain.md)
21
19
* Forward the apex domain to the `www` subdomain
20
+
* Use an `A` record
21
+
22
+
Using an `A` record directs your traffic to a single regional host of your static web app. When enabled, your static web app no longer benefits from its global distribution, and this may affect your application performance. Consider using `ALIAS`, `ANAME` or `CNAME` record for APEX domains for the best performance.
22
23
23
-
This guide demonstrates two options for configuring an apex domain.
24
+
This guide demonstrates three options for configuring an apex domain.
24
25
25
26
* Use the steps to [set up with an ALIAS record](#set-up-with-an-alias-record) if your domain registrar supports the `ALIAS` DNS record.
26
27
27
28
If your registrar doesn't support `ALIAS` records, but does support `ANAME` records or `CNAME` flattening, see their documentation for configuration settings.
28
29
29
30
* Use the steps in [forward to www subdomain](#forward-to-www-subdomain) if your domain registrar doesn't support the `ALIAS` DNS record.
30
31
32
+
* Use the steps to [set up with an A Record](#set-up-with-an-a-record) if the above options do not suit you. With an `A` record, your traffic is directed to a single Static Web Apps host, and your app no longer benefit from the performance improvements provided by global distribution.
33
+
31
34
## Set up with an ALIAS record
32
35
33
36
Before you create the `ALIAS` record, you first need to validate that you own the domain.
@@ -109,6 +112,79 @@ Make sure as you set up forwarding that you only configure the apex domain to fo
109
112
110
113
See your registrar's documentation for details.
111
114
115
+
## Set up with an A record
116
+
117
+
Before you create the `A` record, you first need to validate that you own the domain.
118
+
119
+
### Validate ownership
120
+
121
+
1. Open the [Azure portal](https://portal.azure.com).
122
+
123
+
1. Go to your static web app.
124
+
125
+
1. From the *Overview* window in the top right corner of the *Essentials* section, select **JSON View**.
126
+
127
+
1. Copy the value of the **`stableInboundIP`** property and set it aside in a text editor for future use. This is the IP address of your regional Static Web Apps host.
128
+
129
+
1. Select **+ Add**.
130
+
131
+
1. In the *Enter domain* tab, enter your apex domain name.
132
+
133
+
For instance, if your domain name is `example.com`, enter `example.com` into this box (without any subdomains).
134
+
135
+
1. Select **Next**.
136
+
137
+
1. In the *Validate + Configure* tab, enter the following values.
138
+
139
+
| Setting | Value |
140
+
|---|---|
141
+
| Domain name | This value should match the domain name you entered in the previous step. |
142
+
| Hostname record type | Select **TXT**. |
143
+
144
+
1. Select **Generate code**.
145
+
146
+
Wait as the code is generated. It make take a minute or so to complete.
147
+
148
+
1. Once the `TXT` record value is generated, **copy** (next to the generated value) the code to the clipboard.
149
+
150
+
1. Select **Close**.
151
+
152
+
1. Open a new browser tab and sign in to your domain registrar account.
153
+
154
+
1. Go to your domain name's DNS configuration settings.
155
+
156
+
1. Add a new `TXT` record with the following values.
157
+
158
+
| Setting | Value |
159
+
|--|--|
160
+
| Type |`TXT`|
161
+
| Host | Enter **@**|
162
+
| Value | Paste the generated code value you copied from the Azure portal. |
163
+
| TTL (if applicable) | Leave as default value. |
164
+
165
+
1. Save changes to your DNS record.
166
+
167
+
### Set up an A record
168
+
169
+
1. Return to your domain name's DNS configuration settings.
170
+
171
+
1. Add a new `A` record with the following values.
172
+
173
+
| Setting | Value |
174
+
|--|--|
175
+
| Type |`A`|
176
+
| Host | Enter **@**|
177
+
| Value | Paste the **`stableInboundIP`** you copied from the Azure portal. |
178
+
| TTL (if applicable) | Leave as default value. |
179
+
180
+
1. Save changes to your DNS record.
181
+
182
+
Since DNS settings need to propagate, this process can take some time to complete.
183
+
184
+
1. Open a new browser tab and go to your apex domain.
185
+
186
+
After the DNS records are updated, you should see your static web app in the browser. Also, inspect the location to verify that your site is served securely using `https`.
Copy file name to clipboardExpand all lines: articles/static-web-apps/custom-domain.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,9 @@ 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 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
+
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.
33
35
34
36
The following are terms you'll encounter as you set up a custom domain.
0 commit comments