Custom DNS resolution doesn't work within container

Hi,

I have this situation:

  • My host is a Windows 10 machine
  • I use Docker for Windows using Windows Container
  • I have a custom DNS record in my “c:\Windows\System32\Drivers\etc\hosts” file into the host machine

When I run a new container, I would resolve that DNS from the container. Any suggestion?

I tried different ways but I didn’t find anything that really work.

Thanks,
Carmine

Have you tried the DNS settings on docker run? https://docs.docker.com/engine/reference/run/#network-host

Hi friism,

It seems that using Docker for Windows with Windows Container the “host” network doesn’t exist.

Docker documentation is not really correct, there are a lot of difference between Docker with Linux container and Windows one…

Do you have any other suggestions?

Thanks,
Carmine