How to update the DNS records on Azure RHEL VM?

Arunprasad K 20 Reputation points
2025-01-25T05:04:42.9966667+00:00

Hi All,

We have some RHEL 7.9, SUSE sles 15 and Windows 2016 servers in our environment where we recently changed the DNS servers in Azure vnet. After DNS change Windows servers get update automatically.

Linux servers don't get the update. I found this https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/custom-dns-configuration-for-azure-linux-vms?tabs=RHEL. Following this I ran "sudo netconfig update" and "sudo systemctl restart wicked.service". It change the records in SUSE servers.

But RHEL servers is not getting the updates after running "sudo systemctl restart NetworkManager". I see the old DNS only /etc/resolv.conf. Then I checked /run/NetworkManager/resolv.conf it's having the correct DNS. And I ran "nmcli dev show" it's also having the correct ones.

Should I need to link /run/NetworkManger/resolv.conf and /etc/resolv.conf or should I leave them as it is?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,326 questions
Azure Red Hat OpenShift
Azure Red Hat OpenShift
An Azure service that provides a flexible, self-service deployment of fully managed OpenShift clusters.
91 questions
{count} votes

Accepted answer
  1. Mounika Reddy Anumandla 2,180 Reputation points Microsoft Vendor
    2025-01-27T07:08:12.2166667+00:00

    Hi Arunprasad K,

    Welcome to the Microsoft Q&A Platform. Thank you for posting your query here.

    As per my understanding, linking /run/NetworkManager/resolv.conf and /etc/resolv.conf is generally may not be necessary if your system is already managing DNS resolution correctly.
    I have reproduced your scenario and tried to update the dns of RHEL 9.4 server by following the steps in the documentation mentioned and it worked.

    The initial configuration of the /etc/resolv.conf file in an Azure Linux VM is as shownUser's image

    Configured custom DNS servers at the Azure virtual network or network interface level. User's image

    Restart the NetworkManager service,and then check the /etc/resolv.conf file. This file reflects the new DNS settings configured in the VNetUser's image

    User's image

    Can you please confirm if you have followed above steps and can you please confirm If dhclient is responsible for DNS management or NetworkManager to manage DNS.

    To check this open the NetworkManager.conf file and check [main] dns=default.

    If the comment is helpful, please click "upvote" to let us know.

    Let me know if you have any further queries!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.