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: support/azure/virtual-machines/linux/custom-dns-configuration-for-azure-linux-vms.md
+23-16Lines changed: 23 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,45 @@ 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
+
## [RHEL 10](#tab/RHEL10)
83
+
84
+
Guidance forconfiguring custom DNS on **RHEL 10** is currently being developedin 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)
83
87
84
88
### Configure DNS servers
85
89
86
90
1. The initial configuration of the `/etc/resolv.conf` file in an Azure Ubuntu VM is as shown in the following screenshot.
87
91
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.":::
89
93
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).
91
99
92
100
> [!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:
95
104
96
105
```bash
97
106
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.
102
109
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.
104
111
105
112
:::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
113
107
-
5. Run the following commandto 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.
108
115
109
116
```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