1
votes

I have Virtual Network with two subnets (A and B). Vnet is configured to use a custom DNS server. In one subnet (A) I have a web server which has an appropriate DNS configuration. If I create a VM inside subnet A and I try to open a website using DNS, then everything is working correctly. Subnet B is fully dedicated to Azure Container Instances. When I create a container group with one container (azure cli), and I try to connect to a website, I get an exception that page is not available. It seems that my container instance is not using my custom DNS server assigned for the virtual network. Any ideas what may be wrong?

1

1 Answers

1
votes

When ACI is deployed to an existing vnet and the vnet is configured with the custom DNS server, ACI will not inherit the custom DNS servers. You need to deploy the ACI through YAML file and specify the DNS server in the specification of dnsConfig.

For example, below YAML file, to deploy an ACI with Nginx image in an existing vnet using network profile and configure custom DNS servers. Refer to this.

enter image description here

For more reference, you could read YAML reference: Azure Container Instances