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/tutorial-alias-tm.md
+42-33Lines changed: 42 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: dns
6
6
author: asudbring
7
7
ms.service: azure-dns
8
8
ms.topic: tutorial
9
-
ms.date: 09/19/2024
9
+
ms.date: 03/03/2026
10
10
ms.author: allensu
11
11
ms.custom:
12
12
- template-tutorial #Required; leave this attribute/value as-is.
@@ -90,11 +90,11 @@ Create a virtual network and a subnet to place your web servers in.
90
90
91
91
## Create web server virtual machines
92
92
93
-
Create two Windows Server virtual machines, and install IIS web server on them, and then add DNS labels to their public IPs.
93
+
Create two Linux virtual machines, install NGINX web server on them, and then add DNS labels to their public IPs.
94
94
95
95
### Create the virtual machines
96
96
97
-
Create two Windows Server 2019 virtual machines.
97
+
Create two Ubuntu virtual machines.
98
98
99
99
1. In the Azure portal, enter *virtual machine* in the search box at the top of the portal, and then select **Virtual machines** from the search results.
100
100
2. In **Virtual machines**, select **+ Create** and then select **Azure virtual machine**.
@@ -106,16 +106,17 @@ Create two Windows Server 2019 virtual machines.
106
106
| Subscription | Select your Azure subscription. |
| Authentication type | Select **SSH public key**. |
116
117
| Username | Enter a username. |
117
-
|Password | Enter a password. |
118
-
|Confirm password |Reenter the password. |
118
+
|SSH public key source | Select **Generate new key pair**. |
119
+
|Key pair name|Enter a name for the key pair. |
119
120
|**Inbound port rules**||
120
121
| Public inbound ports | Select **None**. |
121
122
@@ -128,57 +129,65 @@ Create two Windows Server 2019 virtual machines.
128
129
|**Network interface**||
129
130
| Virtual network | Select **myTMVNet**. |
130
131
| Subnet | Select **WebSubnet**. |
131
-
| Public IP | Select **Create new**, and then enter *Web-01-ip* in **Name**. </br> Select **Basic** for the **SKU**, and **Static** for the **Assignment**. |
132
+
| Public IP | Select **Create new**, and then enter *web-01-ip* in **Name**. Select **Standard** for the **SKU**. |
132
133
| NIC network security group | Select **Basic**. |
133
134
| Public inbound ports | Select **Allow selected ports**. |
7. Review the settings, and then select **Create**.
138
-
8. Repeat previous steps to create the second virtual machine. Enter *Web-02* in the **Virtual machine name** and *Web-02-ip* in the **Name** of **Public IP**. For the other settings, use the same information from the previous steps used with first virtual machine.
139
+
8. Repeat previous steps to create the second virtual machine. Enter *web-02* in the **Virtual machine name** and *web-02-ip* in the **Name** of **Public IP**. For the other settings, use the same information from the previous steps used with first virtual machine.
139
140
140
141
Each virtual machine deployment may take a few minutes to complete.
141
142
142
-
### Install IIS web server
143
+
> [!NOTE]
144
+
> The network security group rules block inbound SSH access from the internet. To run commands on the virtual machines, use the **Run command** feature in the Azure portal or deploy Azure Bastion. For more information about Azure Bastion, see [Quickstart: Deploy Azure Bastion with default settings](../bastion/quickstart-host-portal.md).
145
+
146
+
### Install NGINX web server
147
+
148
+
Install NGINX on both **web-01** and **web-02** virtual machines using the **Run command** feature in the Azure portal.
149
+
150
+
1. In the search box at the top of the portal, enter *virtual machine*. Select **Virtual machines** in the search results.
151
+
152
+
1. Select the **web-01** virtual machine.
153
+
154
+
1. In the **Operations** section of the left menu, select **Run command**.
155
+
156
+
1. Select **RunShellScript**.
143
157
144
-
Install IIS on both **Web-01** and **Web-02** virtual machines.
158
+
1. In the **Run Command Script** pane, enter the following command:
145
159
146
-
1. In the **Connect** page of **Web-01** virtual machine, select **RDP** and then **Download RDP File**.
147
-
2. Open *Web-01.rdp* file, and select **Connect**.
148
-
3. Enter the username and password entered during virtual machine creation.
149
-
4. On the **Server Manager** dashboard, select **Manage** then **Add Roles and Features**.
150
-
5. Select **Server Roles** or select **Next** three times. On the **Server Roles** screen, select **Web Server (IIS)**.
151
-
6. Select **Add Features**, and then select **Next**.
160
+
```bash
161
+
sudo apt-get update && sudo apt-get install -y nginx &&echo'Hello World from web-01'| sudo tee /var/www/html/index.html
162
+
```
152
163
153
-
:::image type="content" source="./media/tutorial-alias-tm/iis-web-server-installation.png" alt-text="Screenshot of Add Roles and Features Wizard in Windows Server 2019 showing how to install the I I S Web Server by adding the Web Server role.":::
164
+
1. Select **Run**.
154
165
155
-
7. Select **Confirmation** or select **Next** three times, and then select **Install**. The installation process takes a few minutes to finish.
156
-
8. After the installation finishes, select **Close**.
157
-
9. Go to *C:\inetpub\wwwroot* and open *iisstart.htm* with Notepad or any editor of your choice to edit the default IIS web page.
158
-
10. Replace all the text in the file with `Hello World from Web-01` and save the changes to *iisstart.htm*.
159
-
11. Open a web browser. Browse to **localhost** to verify that the default IIS web page appears.
166
+
1. Wait for the command to complete. The output displays the installation progress and finishes when NGINX is installed.
160
167
161
-
:::image type="content" source="./media/tutorial-alias-tm/iis-on-web-01-vm-in-web-browser.png" alt-text="Screenshot of Internet Explorer showing the I I S Web Server default page of first virtual machine.":::
168
+
1. Repeat the previous steps for the **web-02** virtual machine. Use the following command instead:
162
169
163
-
12. Repeat previous steps to install IIS web server on **Web-02** virtual machine. Use `Hello World from Web-02` to replace all the text in *iisstart.htm*.
170
+
```bash
171
+
sudo apt-get update && sudo apt-get install -y nginx &&echo'Hello World from web-02'| sudo tee /var/www/html/index.html
172
+
```
164
173
165
174
### Add a DNS label
166
175
167
176
Public IP addresses need DNS labels to work with Traffic Manager.
168
177
169
178
1. In the Azure portal, enter *TMResourceGroup*in the search box at the top of the portal, and thenselect**TMResourceGroup** from the search results.
170
-
2. In the **TMResourceGroup** resource group, select the **Web-01-ip** public IP address.
179
+
1. In the **TMResourceGroup** resource group, selectthe**web-01-ip** public IP address.
171
180
3. Under **Settings**, select**Configuration**.
172
181
4. Enter *web01pip*in the **DNS name label**.
173
182
5. Select **Save**.
174
183
175
184
:::image type="content" source="./media/tutorial-alias-tm/ip-dns-name-label-inline.png" alt-text="Screenshot of the Configuration page of Azure Public IP Address showing D N S name label." lightbox="./media/tutorial-alias-tm/ip-dns-name-label-expanded.png":::
176
185
177
-
6. Repeat the previous steps for the **Web-02-ip** public IP address and enter *web02pip* in the **DNS name label**.
186
+
6. Repeat the previous steps forthe **web-02-ip** public IP address and enter *web02pip*in the **DNS name label**.
178
187
179
188
## Create a Traffic Manager profile
180
189
181
-
1. In the **Overview** page of **Web-01-ip** public IP address, note the IP address for later use. Repeat this step for the **Web-02-ip** public IP address.
190
+
1. In the **Overview** page of **web-01-ip** public IP address, note the IP address for later use. Repeat this step for the **web-02-ip** public IP address.
182
191
2. In the Azure portal, enter *Traffic Manager profile*in the search box at the top of the portal, and thenselect**Traffic Manager profiles**.
183
192
3. Select **+ Create**.
184
193
4. In the **Create Traffic Manager profile** page, enter or selectthe following information:
@@ -200,7 +209,7 @@ Public IP addresses need DNS labels to work with Traffic Manager.
200
209
|---------|-------|
201
210
| Type | Select **External endpoint**. |
202
211
| Name | Enter *EP-Web01*. |
203
-
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **Web-01-ip** that you noted previously. |
212
+
| Fully qualified domain name (FQDN) or IP | Enter the IP address for**web-01-ip** that you noted previously. |
204
213
| Priority | Enter *1*. |
205
214
206
215
:::image type="content" source="./media/tutorial-alias-tm/add-endpoint-tm-inline.png" alt-text="Screenshot of the Endpoints page in Traffic Manager profile showing selected settings for adding an endpoint." lightbox="./media/tutorial-alias-tm/add-endpoint-tm-expanded.png":::
@@ -212,7 +221,7 @@ Public IP addresses need DNS labels to work with Traffic Manager.
212
221
|---------|-------|
213
222
| Type | Select **External endpoint**. |
214
223
| Name | Enter *EP-Web02*. |
215
-
| Fully qualified domain name (FQDN) or IP | Enter the IP address for **Web-02-ip** that you noted previously. |
224
+
| Fully qualified domain name (FQDN) or IP | Enter the IP address for**web-02-ip** that you noted previously. |
216
225
| Priority | Enter *2*. |
217
226
218
227
## Create an alias record
@@ -234,9 +243,9 @@ Create an alias record that points to the Traffic Manager profile.
234
243
235
244
## Test the alias record
236
245
237
-
1. From a web browser, browse to `contoso.com` or your apex domain name. You see the IIS default page with `Hello World from Web-01`. The Traffic Manager directed traffic to **Web-01**IIS web server because it has the highest priority. Close the web browser and shut down **Web-01** virtual machine. Wait a few minutes for the virtual machine to completely shut down.
246
+
1. From a web browser, browse to `contoso.com` or your apex domain name. You see the NGINX page with `Hello World from web-01`. The Traffic Manager directed traffic to **web-01** because it has the highest priority. Close the web browser and shut down **web-01** virtual machine. Wait a few minutes for the virtual machine to completely shut down.
238
247
2. Open a new web browser, and browse again to `contoso.com` or your apex domain name.
239
-
3. You should see the IIS default page with `Hello World from Web-02`. The Traffic Manager handled the situation and directed traffic to the second IIS server after shutting down the first server that has the highest priority.
248
+
3. You should see the NGINX page with `Hello World from web-02`. The Traffic Manager handled the situation and directed traffic to the second web server after shutting down the first server that has the highest priority.
0 commit comments