Skip to main content

How does Docker’s internal DNS resolve service names?

Junior Docker
Quick Answer Docker's embedded DNS server (127.0.0.11) answers name lookups inside containers on user-defined networks. When container "web" queries "db", Docker's DNS returns the IP of the container named "db". On the default bridge network this doesn't work รขโ‚ฌโ€ only user-defined networks get DNS resolution by service name.

Answer

Docker assigns DNS records per network; services resolve each other by name.
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