Docker Community Forums

Share and learn in the Docker community.

Use external DNS provider with user defined network

(Equ1nox) #1


I faces a boring issue… I’m not sure if it is an issue or a configuration problem.

When I used the default bridge network and I run this command:

dockerun -it 961bf2f8b1b2

The external DNS resolution work without any problem but when I used an user-defined network created like this:

docker network create --subnet= dockernet

and I run : dockerun -it --network dockernet 961bf2f8b1b2

DNS resolution doesn’t work anymore.

I use a workaround to fix that by bind my /etc/resolv.conf like this:

docker run -it --network dockernet -v /etc/resolv.conf:/etc/resolv.conf 961bf2f8b1b2

I guess there is a more suitable solution because by doing that I loose the automatic dns provide by user-defined network …

EDIT: I’m totally stuck … I really need help :’(