<p>I am having troubles with a Jenkins pod and with the kube-dns. It seems that my Jenkins is offline and I can't install any plugin, and this is because of the DNS.</p>

<p>This is the error that I'm obtaining: "UnknownHostException: updates.jenkins.io"</p>

<p>Because of this error, I cant download any plugin, so my Jenkins is totally useless.</p>

<p>I have exposed my deployment using "HostPort", in order to have my Jenkins in a private IP. It is important to say that this private IP has access to Internet, so my pod should have it too.</p>

<p>This is the content of the /etc/resolv of the pod:</p>

<pre><code>jenkins@jenkins-86b49f4cb4-zchct:/$ cat /etc/resolv.conf
nameserver 10.0.0.10
search default.svc.cluster.local svc.cluster.local cluster.local reddog.microsoft.com
options ndots:5
</code></pre>

<p>And this is my kube-dns:</p>

<pre><code>[root@azureutils1 ~]# kubectl get svc --namespace kube-system --insecure-skip-tls-verify
NAME                   TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
heapster               ClusterIP   10.0.243.103   &lt;none&gt;        80/TCP          5d
kube-dns               ClusterIP   10.0.0.10      &lt;none&gt;        53/UDP,53/TCP   5d
kubernetes-dashboard   ClusterIP   10.0.237.105   &lt;none&gt;        80/TCP          5d
metrics-server         ClusterIP   10.0.34.149    &lt;none&gt;        443/TCP         5d
</code></pre>

<p>So the IP of the resolv.conf matches the IP of kube-dns service. If I expose my Jenkins using a public LoadBalancer I don't have this problem, but I want that my Jenkins stays in a private IP.</p>

<p>Any thought on this issue?</p>

<p>Greetings</p>

Typh
<p>This kind of issues happens because your <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">pod DNS</a> is not configured. It could be fixed by adding:</p>

<pre><code>hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
</code></pre>

<p>to spec of your pod.</p>
