Search code examples
azurednsazure-dns

How to have internal VM resolve hostname in DNS Alias Recordset


I have created an Azure DNS Zone that is acting as the public resolver for hostname resolution. For example, bash $> nslookup myhost.mydomain.com will resolve to xx.yy.zz.aa via Azure name servers when called by an external non-azure host.

The domain mydomain.com is obtained from Google Domains where I have delegated all 4 name servers over to Azure servers. The Google Domain DNS recordset is otherwise empty.

In Azure, The DNS Zone includes an "A" RecordSet that is an Azure Alias to the public IP of the internal VM that is externally known as myhost.

Working well for external hosts, the lookups (and other usages) fail if called from an internal host. For example, on myhost itself or on a peer host in the same internal subnet, the nslookups fail (don't resolve) and the nslookup mydomain.com request retrieves only the internal private IP for the virtual network, the 10. one.

What am I failing to do in order to get internal hosts to resolve FQDNs like the external ones can?


Solution

  • After my validation, the Azure host does work the same as the external clients:

    enter image description here

    You could verify if the DNS servers on the Azure virtual network set the default azure provided DNS or a Custom DNS server 168.63.129.16. Once you change it, you may restart your azure VM to make this effect.

    enter image description here

    Please let me know if you have any questions or show the output when you run nslookup myhost.mydomain.com on the internal hosts.