Q: pod container cannot resolves the host on which it is running I have a unique scenario related to hostname resolution.
I am running a single-node Kubernetes cluster in a server that is in a private network and it doesn't have a DNS server.
So I have configured a host in the /etc/hosts file of my laptop.
Now the problem is I can resolve this host from the node(on which the K8s cluster is running) but I cannot resolve it from inside the pod. Following is the /etc/resolve.conf of the node:
nameserver 127.0.0.53
options edns0

I am getting the following error when I do ping to the host from inside the container
ping: bad address 'hostname'
I would appreciate if anyone can help me here.

A: Use service DNS (FQDN: Full Qualified Domain Name)
If you are exposing your objects (pods, deployments, etc) using a K8S service you can expose them outside namespaces with an IP or with FQDN
Here is an example of how to do it:
https://github.com/nirgeier/KubernetesLabs/tree/master/Labs/05-Services#0403-using-the-full-DNS-name


The name (FQDN) will be the same regardless of the IP and cluster in which your code is deployed.

Official Docs:
https://kubernetes.io/docs/concepts/services-networking/service/#externalname
