Docker Community Forums

Share and learn in the Docker community.

Parametr --dns not working with parametr--net


(Me1ram) #1

when I create container

docker run --dns -td ubunu:latest

It’s ok.

But I need to create container with existing network and static ip

docker run --net my_net --dns --ip -td ubuntu:latest

/etc/resolv.conf entries are

options ndots:0

(Jeff Anderson) #2

As of docker 1.10, docker networks created with the docker network interface utilized an internal DNS service. The --dns option influences what that internal resolver uses to turn around and do resolution with.

(Me1ram) #3

how to assign dns nameservers permanently in user-defined networks?
I updated to 1.11
But problem is the same.

(Jeff Anderson) #4

The --dns options are set per container, and not network wide.