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
+34-29Lines changed: 34 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,16 +56,21 @@ az network vnet subnet create \
56
56
--vnet-name myAzureVNet \
57
57
--resource-group MyAzureResourceGroup \
58
58
--name AzureBastionSubnet \
59
-
--address-prefix 10.2.1.0/24
59
+
--address-prefix 10.2.1.0/26
60
60
61
-
az network private-dns zone create -g MyAzureResourceGroup \
62
-
-n private.contoso.com
61
+
az network private-dns zone create \
62
+
--resource-group MyAzureResourceGroup \
63
+
--name private.contoso.com
63
64
64
-
az network private-dns link vnet create -g MyAzureResourceGroup -n MyDNSLink \
65
-
-z private.contoso.com -v myAzureVNet -e true
65
+
az network private-dns link vnet create \
66
+
--resource-group MyAzureResourceGroup \
67
+
--name MyDNSLink \
68
+
--zone-name private.contoso.com \
69
+
--virtual-network myAzureVNet \
70
+
--registration-enabled true
66
71
```
67
72
68
-
If you want to create a zone just for name resolution (no automatic hostname registration), you could use the `-e false` parameter.
73
+
If you want to create a zone just for name resolution (no automatic hostname registration), you could use the `--registration-enabled false` parameter.
69
74
70
75
### List DNS private zones
71
76
@@ -75,7 +80,7 @@ Specifying the resource group lists only those zones within the resource group:
75
80
76
81
```azurecli
77
82
az network private-dns zone list \
78
-
-g MyAzureResourceGroup
83
+
--resource-group MyAzureResourceGroup
79
84
```
80
85
81
86
Omitting the resource group lists all zones in the subscription:
@@ -121,26 +126,26 @@ Now, create two virtual machines so you can test your private DNS zone:
121
126
122
127
```azurecli
123
128
az vm create \
124
-
-n myVM01 \
125
-
--admin-username AzureAdmin \
126
-
-g MyAzureResourceGroup \
127
-
-l eastus \
128
-
--subnet backendSubnet \
129
-
--vnet-name myAzureVnet \
130
-
--image win2016datacenter \
131
-
--public-ip-address ""
129
+
--name myVM01 \
130
+
--admin-username AzureAdmin \
131
+
--resource-group MyAzureResourceGroup \
132
+
--location eastus \
133
+
--subnet backendSubnet \
134
+
--vnet-name myAzureVnet \
135
+
--image win2016datacenter \
136
+
--public-ip-address ""
132
137
```
133
138
134
139
```azurecli
135
140
az vm create \
136
-
-n myVM02 \
137
-
--admin-username AzureAdmin \
138
-
-g MyAzureResourceGroup \
139
-
-l eastus \
140
-
--subnet backendSubnet \
141
-
--vnet-name myAzureVnet \
142
-
--image win2016datacenter \
143
-
--public-ip-address ""
141
+
--name myVM02 \
142
+
--admin-username AzureAdmin \
143
+
--resource-group MyAzureResourceGroup \
144
+
--location eastus \
145
+
--subnet backendSubnet \
146
+
--vnet-name myAzureVnet \
147
+
--image win2016datacenter \
148
+
--public-ip-address ""
144
149
```
145
150
146
151
Creating a virtual machine will take a few minutes to complete.
@@ -153,10 +158,10 @@ To create a DNS record, use the `az network private-dns record-set [record type]
153
158
154
159
```azurecli
155
160
az network private-dns record-set a add-record \
156
-
-g MyAzureResourceGroup \
157
-
-z private.contoso.com \
158
-
-n db \
159
-
-a 10.2.0.4
161
+
--resource-group MyAzureResourceGroup \
162
+
--zone-name private.contoso.com \
163
+
--record-set-name db \
164
+
--ipv4-address 10.2.0.4
160
165
```
161
166
162
167
### View DNS records
@@ -165,8 +170,8 @@ To list the DNS records in your zone, run:
0 commit comments