As I am new to kubernetes and its DNS service, it would be great if someone helps to clarify the question below. I understand from the kubernetes documentation that kube-dns supports 'services' and 'pods' records and uses to resolve domain names of services or pods.
In a pod, few containers are running. I need those containers to resolve few external domains using kube-dns. Now, how can I use kube-dns to make containers to resolve such external domain names? Do the kubernetes provides dns server only for the resolution of domains within kubernetes? Or is there a way to customize kubernetes provided dns to resolve external domains? If so how to customize it?
It could be really helpful if someone helps to unblock my queries. Thanks in advance!!!
You should take a look first pod's DNS Policy. From the documentation, I shared below.
Then you can configure CoreDNS configmap forward option according to your needs. This documentation will help you to understand.