<p>From the kubernetes docs I see that there is a <a href="http://kubernetes.io/v1.0/docs/user-guide/services.html#dns" rel="noreferrer">DNS based service discovery</a> mechanism. Does Google Container Engine support this. If so, what's the format of DNS name to discover a service running inside Container Engine. I couldn't find the relevant information in the Container Engine docs.</p>

<p>The DNS name for services is as follow: <code>{service-name}.{namespace}.svc.cluster.local</code>.</p>

<p>Assuming you configured <code>kubectl</code> to work with your cluster you should be able to get your service and namespace details by the following the steps below.</p>

<h2>Get your namespace</h2>

<pre><code>$ kubectl get namespaces
NAME          LABELS    STATUS
default       &lt;none&gt;    Active
kube-system   &lt;none&gt;    Active
</code></pre>

<p>You should ignore the <code>kube-system</code> entry, because that is for the cluster itself. All other entries are your <code>namespaces</code>. By default there will be one extra namespace called <code>default</code>. </p>

<h2>Get your services</h2>

<pre><code>$ kubectl get services
NAME                  LABELS                                                    SELECTOR                   IP(S)            PORT(S)
broker-partition0     name=broker-partition0,type=broker                        name=broker-partition0     10.203.248.95    5050/TCP
broker-partition1     name=broker-partition1,type=broker                        name=broker-partition1     10.203.249.91    5050/TCP
kubernetes            component=apiserver,provider=kubernetes                   &lt;none&gt;                     10.203.240.1     443/TCP
service-frontend      name=service-frontend,service=frontend                    name=service-frontend      10.203.246.16    80/TCP
                                                                                                           104.155.61.198   
service-membership0   name=service-membership0,partition=0,service=membership   name=service-membership0   10.203.246.242   80/TCP
service-membership1   name=service-membership1,partition=1,service=membership   name=service-membership1   10.203.248.211   80/TCP
</code></pre>

<p>This command lists all the services available in your cluster. So for example, if I want to get the IP address of the <code>service-frontend</code> I can use the following DNS: <code>service-frontend.default.svc.cluster.local</code>.</p>

<h2>Verify DNS with busybox pod</h2>

<p>You can create a busybox pod and use that pod to execute <code>nslookup</code> command to query the DNS server.</p>

<pre><code>$ kubectl create -f - &lt;&lt; EOF
apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
  - image: busybox
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
    name: busybox
  restartPolicy: Always
EOF
</code></pre>

<p>Now you can do an <code>nslookup</code> from the pod in your cluster.</p>

<pre><code>$ kubectl exec busybox -- nslookup broker-partition0.default.svc.cluster.local
Server:    10.203.240.10 
Address 1: 10.203.240.10

Name:      service-frontend.default.svc.cluster.local
Address 1: 10.203.246.16
</code></pre>

<p>Here you see that the <code>Addres 1</code> entry is the IP of the <code>service-frontend</code> service, the same as the IP address listed by the <code>kubectl get services</code>.</p>
