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
There are few typos and corrections in the filenames and images. So, I verified and corrected them based on the feedback that I received from my team members.
Copy file name to clipboardExpand all lines: support/azure/virtual-machines/linux/custom-dns-configuration-for-azure-linux-vms.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This article provides instructions to configure custom DNS servers and search do
27
27
2. Configure custom DNS servers at the Azure virtual network or network interface level. For more information, see [Steps to change DNS servers at virtual network/network interface level](/azure/virtual-network/manage-virtual-network#change-dns-servers).
28
28
29
29
> [!NOTE]
30
-
> In Azure, you can set custom DNS servers at the virtual network level or the network interface level. If you set custom DNS servers at the network interface level, it will override the the custom DNS servers configuration in the virtual network.
30
+
> In Azure, you can set custom DNS servers at the virtual network level or the network interface level. If you set custom DNS servers at the network interface level, it will override the custom DNS servers configuration in the virtual network.
31
31
32
32
3. Restart the `NetworkManager` service, and then check the `/etc/resolv.conf` file. The file should contain the DNS servers that you configured in the step 2.
33
33
@@ -79,38 +79,41 @@ This article provides instructions to configure custom DNS servers and search do
79
79
80
80
:::image type="content" source="./media/custom-dns-config-images/rhel-dns-6.png" alt-text="Screenshot showing the search domain.":::
81
81
82
-
## [Ubuntu 20.04/22.04](#tab/Ubuntu)
82
+
## [Ubuntu 20.04/22.04/24.04](#tab/Ubuntu)
83
83
84
84
### Configure DNS servers
85
85
86
86
1. The initial configuration of the `/etc/resolv.conf` file in an Azure Ubuntu VM is as shown in the following screenshot.
87
87
88
-
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-1.png" alt-text="Screenshot of default resolv.conf file in Ubuntu.":::
88
+
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-1.png" alt-text="Screenshot of default resolv.conf file in Ubuntu.":::
89
89
90
-
2. Configure custom DNS servers at the Azure virtual network or network interface level. For more information, see [Steps to change DNS servers at virtual network/network interface level](/azure/virtual-network/manage-virtual-network#change-dns-servers).
90
+
2. Starting with Ubuntu20.04, `resolv.conf` file is a symbolic link to `/run/systemd/resolve/stub-resolv.conf`. For more information about this stub file, significance and usage of different `resolv.conf` files, and `systemd-resolved` service, see: https://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html#:~:text=systemd%2Dresolved%20is%20a%20system,an%20LLMNR%20resolver%20and%20responder.
91
+
92
+
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-2.png" alt-text="Screenshot of resolv.conf file linked to stub-resolv.conf file":::
93
+
94
+
3. Configure custom DNS servers at either the Azure virtual network or network interface level. For more information, see [Steps to change DNS servers at virtual network/network interface level](/azure/virtual-network/manage-virtual-network#change-dns-servers).
91
95
92
96
> [!NOTE]
93
-
> In Azure, you can set custom DNS servers at the virtual network level or the network interface level. If you set custom DNS servers at the network interface level, this will override the the custom DNS servers configuration in the virtual network.
94
-
3. Run the following command to apply the configuration of the custom DNS servers:
97
+
> In Azure, you can set custom DNS servers at the virtual network level or the network interface level. If you set custom DNS servers at the network interface level, this will override the custom DNS servers configuration in the virtual network.
98
+
99
+
4. Run the following command to apply the custom DNS configuration:
95
100
96
101
```bash
97
102
sudo netplan apply
98
-
99
-
4. Check the `/run/systemd/resolve/stub-resolv.conf` file. The file should contain the DNS servers that you configured in step 2.
100
-
101
-
Starting is Ubuntu 20, `resolv.conf` file is a symbolic link of `/run/systemd/resolve/stub-resolv.conf` file. This makes sure that the updated DNS servers are reflected in**/run/systemd/resolve/resolv.conf** file. For more information, see [systemd-resolved](https://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html#:~:text=systemd%2Dresolved%20is%20a%20system,an%20LLMNR%20resolver%20and%20responder).
103
+
```
104
+
5. Verify the contents of `/run/systemd/resolve/resolv.conf` file. It should list the DNS servers configured in step 3.
102
105
103
-
The following screenshot shows an example of `/run/systemd/resolve/stub-resolv.conf` after you configure custom DNS server.
106
+
The following screenshot shows an example of `/run/systemd/resolve/resolv.conf` after configuring custom DNS servers.
104
107
105
108
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-3.png" alt-text="Screenshot of non-stub Resolv.conf file after you make changes at portal level":::
106
109
107
-
5. Run the following commandto check whether the custom DNS servers are successfully added to the network interface:
110
+
6. Since `/etc/resolv.conf` is still linked to stub file, unlink and create a new link to `/run/systemd/resolve/resolv.conf`, so that DNS queries the updated custom DNS servers.
108
111
109
112
```bash
110
-
sudo resolvectl status
111
-
```
112
-
113
-
The following screenshot shows an example of the network interface after you configure the search domain:
0 commit comments