<p>I'm running Kuberentes with a Minikube node on my machine. The pods are accessing each other by their .metadata.name, and I would like to have a custom domain to that name.</p>

<p>i.e. one pod accesses Elastic's machine by elasticsearch.blahblah.com</p>

<p>Thanks for any suggestions</p>

<p>You should have DNS records for pods by default due to kube-DNS addon enabled by default in minikube.</p>

<p>To check kube-dns addon status use the below command:</p>

<p><code>kubectl get pod -n kube-system</code></p>

<p>Please find below how cluster add-on DNS server works:</p>

<p>An optional (though strongly recommended) cluster add-on is a DNS server. The DNS server watches the Kubernetes API for new Services and creates a set of DNS records for each. If DNS has been enabled throughout the cluster then all Pods should be able to do name resolution of Services automatically.</p>

<p>For example, if you have a Service called "my-service" in Kubernetes Namespace "my-ns" a DNS record for "my-service.my-ns" is created. Pods which exist in the "my-ns" Namespace should be able to find it by simply doing a name lookup for "my-service". Pods which exist in other Namespaces must qualify the name as "my-service.my-ns". The result of these name lookups is the cluster IP.</p>

<p>Kubernetes also supports DNS SRV (service) records for named ports. If the "my-service.my-ns" Service has a port named "http" with protocol TCP, you can do a DNS SRV query for "_http._tcp.my-service.my-ns" to discover the port number for "http".</p>

<p>The Kubernetes DNS server is the only way to access services of type ExternalName.</p>

<p>You can follow <a href="https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/" rel="nofollow noreferrer">Configure DNS Service</a> document for configuration instructions.</p>

<p>Also, you can check <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">DNS for Services and Pods</a> for additional information.</p>
