Docker Community Forums

Share and learn in the Docker community.

Name resolution not happening in container

dns

(Santosh Kumar Gupta) #1

I’ve a DNS server running in container and the udp/tcp ports are published on the host system.
In host system’s /etc/resolve.conf I’ve added its own ip address and the host system is able to do name resolution even all other system on the network are able to do name resolution using the host server ip.
But other containers which are running on the host system is not able to do name resolution.

Not getting any clue what is happening. Need expert’s input to get it solved.


(Jeff Anderson) #2

What version of docker are you running, and are the affected containers running on the default docker0 network or a custom network?

What is the content of /etc/resolv.conf in the affected containers?


(Santosh Kumar Gupta) #3

I’m using docker version 1.11.0 and using custom network. spinning up the containers with docker compose. In containers the resolve.conf point to docker’s internal dns server 127.0.0.11


(Jeff Anderson) #4

What is the error message you get when you try to do name resolution against the internal dns server?


(Santosh Kumar Gupta) #5

Name resolution simply failing. So as per documentation first docker’s internal name server will try to resolve name and if it is not found than will forward it to dns server configured in the host system or if dns server explicitly defined for the container.

so this is how my network is:

Container on test (172.19.0.x) -> Host System (10.0.0.x) -> DNS server Container (172.18.0.x)

In host system name server ip is set to its own ip 10.0.0.x and its working fine. Other systems in 10.0.0.0 network is also able to resolve name.

It seems like ip tables rules set by docker not allowing access to forwarded ports.