New to Azure and trying to understand DNS resolution for Linux guests.
My VNET is set to two Windows DNS servers in Azure, when I add a Linux VM they are present and I can ping IP addresses and FQDN's in Azure and on-premise across the VPN.
So at the moment:
ping 1.1.1.1 - works
ping hosta.mydomain.com - works
ping hosta - does not work
Traditionally I get the last to work either via adding dns-search to interfaces or resolv.conf, but these are overwritten by Azure each reboot.
I have found that if I add the line
dns-search mydomain.com
to /etc/network/interfaces.d/50-cloud-init.cfg it works.
I am unsure if this is best practice as I have also seen this article "Azure Linux VM name resolution" suggest it should be done via /etc/dhcp/dhclient.conf.
Is someone able to advise what the best way to do this is, one that survives reboots and preferably survives changes at the Azure portal NIC blade?
Cheers