DNS suffixes are not being copied to the started containers. Why? RRS feed

  • Question

  • According my (Linux) experience, /etc/hosts and /etc/resolv.conf of the container host are copied to the instantiated containers, unless a specific option is passed via the `docker run`command line.

    Windows containers do not seem to follow the same behavior: I have had to set the DNS suffixes once the containers have been started, via a registry key. Does somebody else experience the same problem?

    Wednesday, May 11, 2016 7:21 PM

All replies

  • This behavior is due to a known implementation difference between Linux and Windows. In Windows point of view, DNS information such as DNS servers and suffixes is associated with a container network. In fact, you can specify these settings when you use the New-ContainerNetwork PowerShell cmdlet in TP5 by using the DNSServer and DNSSuffix parameters. In Linux, DNS information is associated with an individual container.

    Windows automatically plumbs the DNS information to a container anytime a container endpoint is attached to a container network. Linux will update the /etc/resolv.d file of a container with the DNS information specified as options to docker run. Docker on Linux can also create container name:IP mappings by directly adding these entries to the /etc/hosts file of a container. Windows has no such mechanism at this time.

    Will the New-ContainerNetwork cmdlet meet your needs to specify DNS information?

    Friday, May 27, 2016 3:55 PM