Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

DNS resolution for Linux containers group attached to an Azure virtual network #25

Open
dwrightpulse opened this issue Nov 2, 2018 · 2 comments

Comments

@dwrightpulse
Copy link

I've been doing some testing/trial deployments with Linux containers attached to a private Azure VNet.

The containers launch and run as expected with an auto assigned private IP in the subnet's range - so far so good. The VNet has custom DNS servers set (and Windows VM's attached to a different subnet in the VNet inherit these DNS servers correctly) but none of the Linux containers inherit the custom DNS servers. Looking at the /etc/resolv.conf file I can see that the containers get a DNS server address of 168.63.129.16 with a DNS search domain of .ax.internal.cloudapp.net.

How can I get the containers to inherit the DNS server settings set at the VNet? (I am creating the container groups using az container create with a .YAML file)

Thanks

@yangl900
Copy link

You can customize the DNS server when you create the container groups. A JSON example is here:

https://github.com/Azure/azure-rest-api-specs/blob/21f0dcbb89544101d79be7fc889a86ce0911901b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2018-10-01/examples/ContainerGroupsCreateOrUpdate.json#L73

"dnsConfig": {
          "nameServers": [ "1.1.1.1" ],
          "searchDomains": "cluster.local svc.cluster.local",
          "options": "ndots:2"
},

YAML would be similar. Hope this helps.

@dwrightpulse
Copy link
Author

That's great - thanks for the info and works a treat for me...

Do you know what does the "ndots:2" does? I have tried without and with in the YAML and seemingly no difference...

2 other points you may be able to shed light on:

  1. is there a way to get the containers to do dynamic DNS registration (eg against a Windows Server running DNS)
  2. If 1 not possible is it possible to specify a specific IP address on the VNet for the container group to use within the YAML?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants