<p>I have a kubernetes cluster on which I deployed pods and services.  One of the pod should connect to a service via the service name given its manifest.</p>

<p>All services and pods are deployed in the default namespace.</p>

<p>I have the following error in looking at the logs of the pod:</p>

<pre><code>cassandra cluster ['cassandra'] not reachable: [Errno -8] Unrecognized service

Caused by: java.net.UnknownHostException: cassandra: Name does not resolve
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
        at java.net.InetAddress.getAllByName(InetAddress.java:1192)
        at java.net.InetAddress.getAllByName(InetAddress.java:1126)
        at com.datastax.driver.core.Cluster$Builder.addContactPoint(Cluster.java:884)
</code></pre>

<p>I have a service deployed called cassandra.</p>

<p>When I run nslookup inside a pod here is the output:</p>

<pre><code>kubectl exec -it pod/kairosdb -- nslookup cassandra
nslookup: can't resolve '(null)': Name does not resolve

Name:      cassandra
Address 1: &lt;ip&gt; cassandra.default.svc.cluster.local
</code></pre>

<p>Looking for some help on how to troubleshoot this.</p>

jerome
<p>For local lookup, use the the fully qualified service name. In this case, <strong><em>cassandra.deployed-namespace-name.svc.cluster.local</em></strong>. </p>
