linux - Docker DNS settings -
i try create docker container custom network , dos settings.
docker network create --driver=bridge --opt "com.docker.network.bridge.enable_ip_masquerade"="true" --opt "com.docker.network.bridge.enable_icc"="true" --opt="com.docker.network.driver.mtu"="1500" --opt="com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" net
--
docker run --dns 10.0.0.2 --network=net busybox cat /etc/resolv.conf
nameserver 127.0.0.11 options ndots:0
else if use standard network work fine
docker run --dns 10.0.0.2 --network=bridge busybox cat /etc/resolv.conf
nameserver 10.0.0.2
as of docker 1.10, dns managed differently user-defined networks. dns default bridge network unchanged backwards compatibility. in user-defined network, docker daemon uses embedded dns server. according documentation found here:
https://docs.docker.com/engine/userguide/networking/configure-dns/
--dns=[ip_address...] ip addresses passed via --dns option used embedded dns server forward dns query if embedded dns server unable resolve name resolution request containers. these --dns ip addresses managed embedded dns server , not updated in container’s /etc/resolv.conf file.
so, dns nameserver used, not visible in container's /etc/resolv.conf.
Comments
Post a Comment