Skip to content

Commit 0338f5b

Browse files
authored
Update custom-dns-configuration-for-azure-linux-vms.md
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.
1 parent b085919 commit 0338f5b

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

support/azure/virtual-machines/linux/custom-dns-configuration-for-azure-linux-vms.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This article provides instructions to configure custom DNS servers and search do
2727
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).
2828

2929
> [!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.
3131
3232
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.
3333

@@ -79,38 +79,41 @@ This article provides instructions to configure custom DNS servers and search do
7979

8080
:::image type="content" source="./media/custom-dns-config-images/rhel-dns-6.png" alt-text="Screenshot showing the search domain.":::
8181

82-
## [Ubuntu 20.04/22.04](#tab/Ubuntu)
82+
## [Ubuntu 20.04/22.04/24.04](#tab/Ubuntu)
8383

8484
### Configure DNS servers
8585

8686
1. The initial configuration of the `/etc/resolv.conf` file in an Azure Ubuntu VM is as shown in the following screenshot.
8787

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.":::
8989

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).
9195

9296
> [!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:
95100

96101
```bash
97102
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.
102105

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.
104107

105108
:::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":::
106109

107-
5. Run the following command to 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.
108111

109112
```bash
110-
sudo resolvectl status
111-
```
112-
113-
The following screenshot shows an example of the network interface after you configure the search domain:
113+
unlink /etc/resolv.conf
114+
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
115+
```
116+
The following screenshot shows an example output of the `resolvecl status` command:
114117

115118
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-4.png" alt-text="Screenshot of resolvectl status command output.":::
116119

0 commit comments

Comments
 (0)