Docker service host is not available inside container

I have asked this question in stackoverflow. Basically, accessing a service using service name as hostname is not working. I do not want to repeat all the details again. Please check the link provided, where I have provided all the details & steps of the setup & problem.