<p>I am deploy eureka in kubernetes(v1.15.2) cluster.Now I want to using my app pod register to eureka by domain name,first I try this way:</p>

<pre><code>http://eureka-0.eureka.dabai-fat.svc.cluster.local:8761
</code></pre>

<p>It not works.I am login my app pod using this command:</p>

<pre><code>/opt/k8s/bin/kubectl exec -ti soa-room-service-6c4448dfb6-grhtb -n dabai-fat /bin/sh
</code></pre>

<p>and using curl command to access cluster's eureka this way:</p>

<pre><code>  / # curl http://eureka-0.eureka.dabai-fat.svc.cluster.local:8761
curl: (6) Could not resolve host: eureka-0.eureka.dabai-fat.svc.cluster.local
</code></pre>

<p>but using this way works:</p>

<pre><code>/ # curl http://172.30.224.17:8761
{"timestamp":"2020-02-03T17:10:23.037+0000","status":401,"error":"Unauthorized","message":"Unauthorized","path":"/"}
</code></pre>

<p>But I think the domain or dns way is better because the ip could floating in the future. So what is the right way to register to eureka using dns? My coredns in the namespace <code>kube-sytem</code>,and my eureka service and app pod in <code>dabai-fat</code> namespace. By the way,this is my eureka service info in kubernetes:</p>

<p><a href="https://i.stack.imgur.com/PjVE0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PjVE0.png" alt="enter image description here"></a></p>

Dolphin
<p>Do you have service with name <code>eureka-0.eureka</code> in <code>dabai-fat</code> namespace ? You can check it via <code>kubectl get svc -n dabai-fat</code>.</p>
