<p>I am having an issue with Kubernetes on GKE. I am unable to resolve services by name. I got an <code>drone-server</code> service running which is connected to a single pod. The ingress connected to the service is successfully connecting but when trying to do for example a <code>nslookup</code> from a <code>busybox</code> pod is it unable to resolve the hostname.</p>

<p><strong>Services:</strong></p>

<pre><code>$ k get services -n drone
NAME           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
drone-server   ClusterIP   10.39.242.23    &lt;none&gt;        80/TCP    2d
drone-vault    ClusterIP   10.39.248.166   &lt;none&gt;        80/TCP    40m
</code></pre>

<p><strong>Busybox nslookup:</strong></p>

<pre><code>$ kubectl exec -ti busybox -- nslookup drone-server
Server:    10.39.240.10
Address 1: 10.39.240.10 kube-dns.kube-system.svc.cluster.local

nslookup: can't resolve 'drone-server'
</code></pre>

<p>When i try to lookup <code>kubernetes.default</code> am I getting a local address back:</p>

<pre><code>$ kubectl exec -ti busybox -- nslookup kubernetes.default
Server:    10.39.240.10
Address 1: 10.39.240.10 kube-dns.kube-system.svc.cluster.local

Name:      kubernetes.default
Address 1: 10.39.240.1 kubernetes.default.svc.cluster.local
</code></pre>

<p><strong>Resolv config:</strong></p>

<p><code>/etc/resolv.conf</code> seems to be configured correctly (the nameserver is matching the kube-dns service cluster ip).</p>

<pre><code>$ kubectl exec -ti busybox -- cat /etc/resolv.conf
nameserver 10.39.240.10
search default.svc.cluster.local svc.cluster.local cluster.local europe-west3-a.c.cluster-a8e6d9e252b63e03.internal c.cluster-a8e6d9e252b63e03.internal google.internal
options ndots:5
</code></pre>

Jeroen Rinzema
<p>Your <code>drone-server</code> service is in the <code>drone</code> namespace and you're trying to nslookup from default namespace. You need to provide the namespace also in command as follows:</p>

<pre><code>kubectl exec -ti busybox -- nslookup drone-server.drone
</code></pre>

<p>This is because your busybox in the default namespace and it tries to look drone-server in same namespace.</p>
