Change VM DNS Servers

Makkah Mohamed 101 Reputation points
2020-08-10T10:35:08.853+00:00

we want to change the DNS Servers IPs on the Azure VM, when change it manually its back again and everything's got stopped.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
594 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,086 questions
{count} votes

Accepted answer
  1. Moamen Hany 1,091 Reputation points MVP
    2020-08-10T12:27:33.287+00:00

    I hope that my replay is understood
    https://learn.microsoft.com/answers/answers/63465/view.html

    Please do not forget to "Accept the answer" and Upvote on the post that helps you, this can be beneficial to other community members.
    http://www.moamenhany.com

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Didier3001 966 Reputation points Microsoft Employee
    2020-08-10T12:03:42.783+00:00

    Hi @Makkah Mohamed

    Any network configuration (DNS, static IP...) must be done from the Azure portal and not from within the VM itself.

    This is documented here:
    https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface#change-dns-servers

    --I hope this helps. Please Accept it as an answer and "Up-Vote" the answer or message(s) that helped you so that it can help others in the community looking for help on similar topics

    Regards,
    Didier3001

    2 people found this answer helpful.
    0 comments No comments

  2. msrini-MSFT 9,256 Reputation points Microsoft Employee
    2020-08-10T12:05:21.363+00:00

    Hi,

    You need to do that change via Azure portal. Navigate to your VNET, click on DNS servers and enter the DNS server IPs. Then reboot your VM. Then your VM will use the DNS servers which you mentioned over the portal for DNS resolutions.

    Do not change it in the guest OS level.

    Regards,
    Msrini

    1 person found this answer helpful.

  3. Ibrahima MBODJI 6 Reputation points
    2020-09-26T13:38:11.72+00:00

    28463-vnet-custom.png@Makkah Mohamed have you been able to resolve your issue ?

    As said above you need to define custom DNS servers at VNET level and not at the OS guest level . If you want to apply custom DNS for production VM only you should consider defining another VNET where you can use Azure provided DNS . A workaround would be before this change to use custom DNS at NIC level where the DNS server is 168.63.129.16.

    28443-custom-nic.png

    1 person found this answer helpful.
    0 comments No comments