<p>I am trying to test inter-pod communication without expose as service.
I have read that a pod does have FQDN in kubedns.
<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">kubernetes doc</a></p>

<p>Its default should be (A Record)<br>
metadata_name.namespace.svc.cluster.local<br>
or<br>
hostname.subdomain.namespace.svc.cluster.local  </p>

<p>But I tried both with curl and nslookup. All failed. The service is healthy, I could curl it with pod IP (172.17.0.5)</p>

<blockquote>
  <p>curl: (6) could not resolve host<br>
  nslookup: can't resolve '(null)': Name does not resolved</p>
</blockquote>

<p>What am I missing?</p>

Maxi Wu
<blockquote>
  <p>If there exists a headless service in the same namespace as the pod
  and with the same name as the subdomain, the cluster’s KubeDNS Server
  also returns an A record for the Pod’s fully qualified hostname. For
  example, given a Pod with the hostname set to “busybox-1” and the
  subdomain set to “default-subdomain”, and a headless Service named
  “default-subdomain” in the same namespace, the pod will see its own
  FQDN as “busybox-1.default-subdomain.my-namespace.svc.cluster.local”.</p>
</blockquote>

<p>So in your case you need to define subdomain for pod and create <a href="https://kubernetes.io/docs/concepts/services-networking/service/#headless-services" rel="nofollow noreferrer">headless service</a> with the same name which points to pods.</p>
