Skip to main content

How does Docker handle DNS resolution for containers on user-defined networks?

Mid Docker
Quick Answer Docker's embedded DNS server (127.0.0.11) resolves container names to IPs on user-defined networks. When a container's IP changes (on restart), Docker updates the DNS entry automatically. This works only on user-defined networks รขโ‚ฌโ€ containers on the default bridge use IPs directly, not names.

Answer

Docker embeds a DNS server inside each network; containers register by name for service discovery.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice