<p>Hello I have a problem in kubernetes. When I do a nslookup from a pod I get correct ip:</p>
<pre><code>~ kubectl -n exampleNamespace exec -it pod/curl -- nslookup exampleService.exampleNamespace
Defaulting container name to curl.
Use 'kubectl describe pod/curl -n exampleNamespace' to see all of the containers in this pod.
Server:     192.168.3.10
Address:    192.168.3.10:53

** server can't find exampleService.exampleNamespace: NXDOMAIN

Non-authoritative answer:
Name:   exampleService.exampleNamespace
Address: 192.168.3.64

command terminated with exit code 1
</code></pre>
<p>192.168.3.64 is the correct ip but when I try to curl this DNS from a pod in the same namespace I get this:</p>
<pre><code>~ kubectl -n exampleNamespace exec -it pod/curl -- curl http://exampleService.exampleNamespace/path
Defaulting container name to curl.
Use 'kubectl describe pod/curl -n exampleNamespace' to see all of the containers in this pod.
curl: (6) Could not resolve host: exampleService.exampleNamespace
command terminated with exit code 6
</code></pre>
<p>Curl pod was started with following yaml:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: curl
  namespace: exampleNamespace
spec:
  containers:
  - image: curlimages/curl
    command:
      - sleep
      - &quot;3600&quot;
    imagePullPolicy: IfNotPresent
    name: curl
  restartPolicy: Always
</code></pre>

<p>It seams that there are some problems with <code>Alpine</code> and <code>Kubernetes</code> dns resolution as reported at some sites:</p>
<ul>
<li><a href="https://www.openwall.com/lists/musl/2018/03/30/9" rel="nofollow noreferrer">https://www.openwall.com/lists/musl/2018/03/30/9</a></li>
<li><a href="https://stackoverflow.com/questions/65181012/does-alpine-have-known-dns-issue-within-kubernetes">Does Alpine have known DNS issue within Kubernetes?</a></li>
<li><a href="https://github.com/gliderlabs/docker-alpine/issues/8" rel="nofollow noreferrer">https://github.com/gliderlabs/docker-alpine/issues/8</a></li>
<li><a href="https://github.com/kubernetes/kubernetes/issues/30215" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/30215</a></li>
</ul>
<p>Using image <code>curlimages/curl:7.77.0</code> works as expected.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: curl
  namespace: exampleNamespace
spec:
  containers:
  - image: curlimages/curl:7.77.0
    command:
      - sleep
      - &quot;3600&quot;
    imagePullPolicy: IfNotPresent
    name: curl
  restartPolicy: Always
</code></pre>
