<p>by default, in Kubernetes 1.13 CoreDNS is installed. 
Can you please tell me how to make a curl in a cluster by the name of the service?</p>

<pre><code>[root@master ~]# kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.233.0.1   &lt;none&gt;        443/TCP   24h
[root@master ~]# kubectl get services --all-namespaces
NAMESPACE       NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                       AGE
kube-system     coredns                ClusterIP   10.233.0.3      &lt;none&gt;        53/UDP,53/TCP,9153/TCP                                        21h
tools           nexus-svc              NodePort    10.233.17.152   &lt;none&gt;        8081:31991/TCP,5000:31111/TCP,8083:31081/TCP,8082:31085/TCP   14h

[root@master ~]# kubectl describe services nexus-svc --namespace=tools
Name:                     nexus-svc
Namespace:                tools
Labels:                   tools=nexus
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"tools":"nexus"},"name":"nexus-svc","namespace":"tools"},"spec"...
Selector:                 tools=nexus
Type:                     NodePort
IP:                       10.233.17.152
Port:                     http  8081/TCP
.....
</code></pre>

<p>So I get the correct answer.</p>

<pre><code>[root@master ~]# curl http://10.233.17.152:8081

&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
  &lt;title&gt;Nexus Repository Manager&lt;/title&gt;
....
</code></pre>

<p>And so no.</p>

<pre><code>[root@master ~]# curl http://nexus-svc.tools.svc.cluster.local
curl: (6) Could not resolve host: nexus-svc.tools.svc.cluster.local; Unknown error
[root@master ~]# curl http://nexus-svc.tools.svc.cluster.local:8081
curl: (6) Could not resolve host: nexus-svc.tools.svc.cluster.local; Unknown error
</code></pre>

<p>Thanks.</p>

JDev
<p><code>coredns</code> or <code>kubedns</code> are meant to resolve the service name to its <code>clusterIP</code> (normal service) or correspondent Pod IP (headless service) inside the kubernetes cluster not outside. You are trying to curl the service name on the node, not inside the pod and hence it is not able to resolve the service name to its clusterIP.</p>

<p>YOu can go inside the pod and try following:</p>

<pre><code>kubectl exec -it &lt;pod_name&gt; bash
nslookup nexus-svc.tools.svc.cluster.local
</code></pre>

<p>It will return you cluster IP and it means <code>coredns</code> is working fine. If your pod has curl utility then you can also curl it using service name (but from inside the cluster only)</p>

<p>If you want to access the service from outside the cluster, this service already exposed as <code>NodePort</code> so you can access it using:</p>

<pre><code> curl http://&lt;node_ip&gt;:31991
</code></pre>

<p>Hope this helps.</p>
