<p>On GKE, <strong>kube-dns</strong> is running on my nodes, I can see the docker containers.</p>

<p>I do have access to <strong>Services</strong> by name, which is great for all these applications where load balancing is a perfectly suitable solution, but <em>how would I use the DNS to access individual pods?</em> </p>

<p>I know I can look up specific pods in the API, but I need to update the <code>hosts</code> file myself, and keep watching the pod list. DNS is supposed to do that for me so how is it meant to be used within a pod?</p>

<p>The Kubernetes doc says the DNS info needs to be passed to the kubelet but I have no access to that on GKE that I know of, so is it just not setup that way on GKE or is there something to do to activate it? </p>

<p>Some of my services (zookeeper in particular) is aware of other nodes on its own, and tries to connect to them by host name (that is pod name) and that fails unless I update the <code>hosts</code> file myself. I would like to use the integrated DNS service for that.</p>

<p>Any guidance on how to do this would be appreciated.</p>

<p>Thanks</p>

<p><strong>UPDATE</strong></p>

<p>According to the docs, the format is now:</p>

<p><code>_my-port-name._my-port-protocol.my-svc.my-namespace.svc.cluster.local</code></p>

<p>See the related doc here:
<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pods" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pods</a></p>

<p><strong>ORIGINAL ANSWER:</strong></p>

<p>as of this date, this is actually not possible... but it is being looked at by the Kubernetes team.</p>

<p>See this issue : <a href="https://github.com/kubernetes/kubernetes/issues/13552" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/13552</a></p>

<p><strong>UPDATE</strong>:</p>

<p>DNS is available for Pods since 09/2015
See PR:<a href="https://github.com/kubernetes/kubernetes/pull/13759" rel="noreferrer">https://github.com/kubernetes/kubernetes/pull/13759</a></p>

<p>in short: </p>

<blockquote>
  <p>This will give pods dns in the form of
  <code>&lt;podIP&gt;.&lt;namespace&gt;.pod.&lt;clusterSuffix&gt;</code> Currently can be disabled, but
  is either on for all pods or off.</p>
</blockquote>
