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/private-dns-getstarted-cli.md
+53-11Lines changed: 53 additions & 11 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: quickstart
8
-
ms.date: 11/30/2023
8
+
ms.date: 07/11/2025
9
9
ms.author: allensu
10
10
ms.custom:
11
11
- devx-track-azurecli
@@ -52,6 +52,12 @@ az network vnet create \
52
52
--subnet-name backendSubnet \
53
53
--subnet-prefixes 10.2.0.0/24
54
54
55
+
az network vnet subnet create \
56
+
--vnet-name myAzureVNet \
57
+
--resource-group MyAzureResourceGroup \
58
+
--name AzureBastionSubnet \
59
+
--address-prefix 10.2.1.0/24
60
+
55
61
az network private-dns zone create -g MyAzureResourceGroup \
56
62
-n private.contoso.com
57
63
@@ -78,6 +84,37 @@ Omitting the resource group lists all zones in the subscription:
78
84
az network private-dns zone list
79
85
```
80
86
87
+
## Deploy Azure Bastion
88
+
89
+
Azure Bastion uses your browser to connect to VMs in your virtual network over secure shell (SSH) or remote desktop protocol (RDP) by using their private IP addresses. The VMs don't need public IP addresses, client software, or special configuration. For more information about Azure Bastion, see [Azure Bastion](/azure/bastion/bastion-overview).
Create a public IP address for the Azure Bastion host with [az network public-ip create](/cli/azure/network/public-ip).
95
+
96
+
```azurecli
97
+
az network public-ip create \
98
+
--resource-group MyAzureResourceGroup \
99
+
--name public-ip-bastion \
100
+
--location eastus \
101
+
--allocation-method Static \
102
+
--sku Standard
103
+
```
104
+
105
+
Create an Azure Bastion host with [az network bastion create](/cli/azure/network/bastion). Azure Bastion is used to securely connect to the virtual machines without exposing them to the public internet.
106
+
107
+
```azurecli
108
+
az network bastion create \
109
+
--resource-group MyAzureResourceGroup \
110
+
--name bastion \
111
+
--vnet-name myAzureVNet \
112
+
--public-ip-address public-ip-bastion \
113
+
--location eastus \
114
+
--sku Basic \
115
+
--no-wait
116
+
```
117
+
81
118
## Create the test virtual machines
82
119
83
120
Now, create two virtual machines so you can test your private DNS zone:
@@ -90,9 +127,8 @@ az vm create \
90
127
-l eastus \
91
128
--subnet backendSubnet \
92
129
--vnet-name myAzureVnet \
93
-
--nsg NSG01 \
94
-
--nsg-rule RDP \
95
-
--image win2016datacenter
130
+
--image win2016datacenter \
131
+
--public-ip-address ""
96
132
```
97
133
98
134
```azurecli
@@ -103,9 +139,8 @@ az vm create \
103
139
-l eastus \
104
140
--subnet backendSubnet \
105
141
--vnet-name myAzureVnet \
106
-
--nsg NSG01 \
107
-
--nsg-rule RDP \
108
-
--image win2016datacenter
142
+
--image win2016datacenter \
143
+
--public-ip-address ""
109
144
```
110
145
111
146
Creating a virtual machine will take a few minutes to complete.
@@ -142,18 +177,25 @@ Now you can test the name resolution for your **private.contoso.com** private zo
142
177
143
178
You can use the ping command to test name resolution. So, configure the firewall on both virtual machines to allow inbound ICMP packets.
144
179
145
-
1. Connect to myVM01, and open a Windows PowerShell window with administrator privileges.
146
-
2. Run the following command:
180
+
1. In the [Azure portal](https://portal.azure.com), search for and select **Virtual machines**.
181
+
182
+
1. Select **myVM01**.
183
+
184
+
1. In **Overview**, select **Connect** > **Connect via Bastion**.
185
+
186
+
1. Enter the username and password you created when you deployed the virtual machine, then select **Connect**.
187
+
188
+
1. Open a Windows PowerShell window and run the following command:
0 commit comments