Azure Container Instance does not resolve name within the same vnet using private DNS zone

jbx999 246 Reputation points
2021-03-04T19:46:01.79+00:00

I have a Vnet with 2 virtual machines and 2 container instances.
I have 2 subnets, 10.0.0.0/24 and 10.0.1.0/24, because apparently Container Instances cannot be deployed in subnets that have other types of resources for some reason.

I have a Private DNS Zone with automatic registration, linked to this vnet and the 2 VMs can resolve each other by name. They also show up in the list of registered records, resolving to 10.0.0.4 and 10.0.0.5 respectively.

However, when I try to connect from the Container Instance to the VM, the name does not resolve. If I connect directly by IP address it works.

Furthermore the 2 container instances don't even show up in the Private DNS Zone.

Is there anything I need to do for my ACI to make use of the Private DNS Zone just like the normal VMs are doing? Why are they not resolving names through the Private DNS Zone as they should?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
635 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,852 questions
{count} vote

3 answers

Sort by: Most helpful
  1. jbx999 246 Reputation points
    2021-04-04T10:47:40.787+00:00

    In the end I decided to move away from Azure Container Instances. They are a half baked, buggy and unstable product, with crucial functionality missing. You can't expose an ACI that is inside a vnet publicly. Accessing resources inside the vnet by DNS doesn't work properly. Registering the container itself to the private DNS zone works erratically. Furthermore West EU zone seems to be unstable, with support unable to figure out what is going on.

    Just stay away from ACI.

    2 people found this answer helpful.

  2. prmanhas-MSFT 17,886 Reputation points Microsoft Employee
    2021-03-05T08:06:52.327+00:00

    @jbx999 Below thread might be helpful:

    https://stackoverflow.com/questions/64700687/how-to-get-azure-container-instances-using-my-dns-server

    Hope it helps!!!

    Please “Accept as Answer” if it helped so it can help others in community looking for help on similar topics


  3. Eikens, A.H.R. (Guus) 1 Reputation point
    2022-08-09T12:52:31.27+00:00

    If I explicitly configure the Container-Instance's DNS servers .... it works. And fortunately Bicep can figure out those DNS-servers of my Virtual Network for me.

    resource resourceVirtualNetwork 'Microsoft.Network/virtualNetworks@2021-02-01' existing = {
    name: virtualNetwork_Name
    scope: resourceGroup(virtualNetwork_ResourceGroup_Name)
    }

    resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = {
    name: containergroup_Name
    location: location
    properties: {
    dnsConfig:{
    nameServers: resourceVirtualNetwork.properties.dhcpOptions.dnsServers
    }
    containers: [
    {
    name: containergroup_Name
    properties: {
    image: image
    ........
    .........

    0 comments No comments