0
0
Dockerdevops~5 mins

DNS resolution between containers in Docker - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is DNS resolution between containers in Docker?
It is the process where containers use container names as hostnames to find and communicate with each other automatically within the same Docker network.
Click to reveal answer
beginner
How does Docker enable DNS resolution between containers?
Docker creates an internal DNS server for each user-defined network. Containers connected to this network can resolve each other's names to IP addresses automatically.
Click to reveal answer
beginner
What command creates a user-defined Docker network for DNS resolution?
docker network create my-network
Click to reveal answer
beginner
How do you connect containers to the same network for DNS resolution?
Use the --network option when running containers, for example: docker run --network my-network --name container1 busybox
Click to reveal answer
intermediate
What happens if containers are on the default bridge network regarding DNS resolution?
Containers on the default bridge network cannot resolve each other by name automatically; you must use IP addresses or create a user-defined network.
Click to reveal answer
Which Docker network type supports automatic DNS resolution between containers?
ADefault bridge network
BHost network
CNone network
DUser-defined bridge network
What is the correct command to create a Docker network named 'app-net'?
Adocker network create app-net
Bdocker create network app-net
Cdocker network new app-net
Ddocker create app-net network
How do containers resolve each other's names inside a user-defined network?
AUsing external DNS servers
BUsing Docker's internal DNS server
CUsing hosts file only
DThey cannot resolve names automatically
If two containers are on different user-defined networks, can they resolve each other's names?
AOnly if they share the same image
BYes, always
CNo, DNS resolution works only within the same network
DOnly if they use host networking
Which option connects a container to a specific Docker network?
A--network
B--net-connect
C--link
D--connect-network
Explain how DNS resolution works between Docker containers on the same user-defined network.
Think about how containers find each other by name inside Docker.
You got /4 concepts.
    Describe the steps to enable DNS resolution between two Docker containers.
    Focus on network creation and container startup options.
    You got /4 concepts.