Docker Community Forums

Share and learn in the Docker community.

Parametr --dns not working with parametr--net

dns
docker

(Me1ram) #1

when I create container

docker run --dns 8.8.8.8 -td ubunu:latest

It’s ok.

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

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

/etc/resolv.conf entries are

nameserver 127.0.0.11
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.