Name resolution not happening in container

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.

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?

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

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

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 network is also able to resolve name.

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