Default Behaviour of Custom DNS Servers on Virtual Network

devopsfj 256 Reputation points
2023-06-22T12:00:13.0533333+00:00

I have a Virtual Network setup in Azure which has two custom DNS Servers, for example:

10.0.0.100 10.1.1.200

What is the default behaviour, in what order do the DNS Servers get queried from a Virtual Machine?

I ask this because one of these DNS Servers is responsible for a specific domain (contoso.com for example), but when I query this domain from a Virtual Machine inside the VNET, the DNS query fails, unless I specifically target the second DNS Server like below

nslookup example.contso.com 10.1.1.200

I am just trying to understand the behaviour, I would of thought that by default the VM would try both DNS Servers for a DNS query, but that doesn't seem the case.

Does the VM try the first server, and if that is offline/unreachable it then tries the second VM.

Thanks

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,017 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
0 comments No comments
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 50,021 Reputation points Microsoft Employee Moderator
    2023-06-22T13:51:36.2933333+00:00

    Hello @devopsfj ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know the default behavior of Custom DNS Servers on Azure Virtual Network.

    By default, DNS servers are used in the order that they're specified in the list. They don't work as a round-robin setup. If the first DNS server in the list can be reached, the client uses that DNS server, regardless of whether the DNS server is functioning properly.

    enter image description here

    So, you should add the DNS server addresses in the correct order for your environment. If they are not in the correct order, you should remove all the DNS servers that are listed, and then add them back in the order that you want.

    Refer: https://learn.microsoft.com/en-us/azure/virtual-network/manage-virtual-network#change-dns-servers-of-a-virtual-network-using-the-azure-portal

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


1 additional answer

Sort by: Most helpful
  1. msrini-MSFT 9,291 Reputation points Microsoft Employee
    2023-06-22T12:17:00.9633333+00:00

    Yes, you are right. All DNS query will be sent to 1st DNS server and only when the server becomes unavailable the query is sent to second DNS server.

    0 comments No comments

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.