Skip to content

Commit 1603e6c

Browse files
author
Amson Liu
authored
Merge pull request #9318 from vkchilak/patch-3
AB#6635: Update custom-dns-configuration-for-azure-linux-vms.md
2 parents be04712 + 35adc5c commit 1603e6c

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

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

Lines changed: 23 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,45 @@ 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+
## [RHEL 10](#tab/RHEL10)
83+
84+
Guidance for configuring custom DNS on **RHEL 10** is currently being developed in collaboration with Red Hat. This section will be updated once validated instructions are available. Please check back for the latest information.
85+
86+
## [Ubuntu 20.04/22.04/24.04](#tab/Ubuntu)
8387

8488
### Configure DNS servers
8589

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

88-
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-1.png" alt-text="Screenshot of default resolv.conf file in Ubuntu.":::
92+
:::image type="content" source="./media/custom-dns-config-images/ubuntu-dns-1.png" alt-text="Screenshot of default resolv.conf file in Ubuntu.":::
8993

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).
94+
2. Starting with Ubuntu 20.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 [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)
95+
96+
:::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":::
97+
98+
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).
9199

92100
> [!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:
101+
> 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.
102+
103+
4. Run the following command to apply the custom DNS configuration:
95104

96105
```bash
97106
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).
107+
```
108+
5. Verify the contents of `/run/systemd/resolve/resolv.conf` file. It should list the DNS servers configured in step 3.
102109

103-
The following screenshot shows an example of `/run/systemd/resolve/stub-resolv.conf` after you configure custom DNS server.
110+
The following screenshot shows an example of `/run/systemd/resolve/resolv.conf` after configuring custom DNS servers.
104111

105112
:::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":::
106113

107-
5. Run the following command to check whether the custom DNS servers are successfully added to the network interface:
114+
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.
108115

109116
```bash
110-
sudo resolvectl status
111-
```
112-
113-
The following screenshot shows an example of the network interface after you configure the search domain:
117+
unlink /etc/resolv.conf
118+
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
119+
```
120+
The following screenshot shows an example output of the `resolvecl status` command:
114121

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

0 commit comments

Comments
 (0)