I mainly use Azure for IaaS purposes (Linux and Windows VM's). We have a strict Front-End (FE) / Back-end (BE) segregation policy.
FE and BE are in the same Virtual Network, but in different Subnets/Cloud Services.
I've noticed that FE and BE VM's are getting different DNS suffixes via DHCP:
- FE machines get frontend-something.a9.internal.cloudapp.net as DNS search suffix
- BE machines get backend-something.a1.internal.cloudapp.net as DNS search suffix
FE machines can reach each other simply by hostname thanks to this search suffix but can't reach BE machines unless I add the BE DNS search suffix in their config.
My question is: Is there a way (via PowerShell / Azure CLI) to find out what DNS suffix is used in a subnet/Cloud Service ?
I need this to automate deployments and I can't predict what the internal DNS search suffix will be (like the "a9" and "a1" that I don't control and that appear in the DNS search suffixed examples above).