Skip to content

Network

DNS in docker

Docker has a built in DNS. However, containers on the default bridge network can only access each other by IP addresses, unless you use the --link option, which is considered legacy. If your containers are connected to the same user defined network they can reference each other using the container name or alias.

Create a user defined network
docker network create -d bridge br0

Create new containers with --net br0

To connect the running container to the new network.
docker network connect br0 <container name>