Pod trying to curl a service : "Could not resolve host"

Hey, I’ve tried getting information about DNS discovery. I thought maybe I need to configure this, but by the docs, it seems this is supposed to be built-in.

In my pod, I tried to curl against the load balancer I created for him. When I curl against the cluster IP & Internal IP of the service - it’s working. but when I try to use the service name (eg: curl http://ranks-service:80/rank) I get the error: “curl: (6) Could not resolve host: ranks-service” I checked /etc/hosts: localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet fe00::0 ip6-mcastprefix fe00::1 ip6-allnodes fe00::2 ip6-allrouters ranks-864cf4c995-gk5g5

I would really appreciate having some help with this, Thanks!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted