<p>Before a Pod is instantiated, Kubelet needs to pull the container image, and for this, it relies on the host's DNS settings, typically found in <code>/etc/resolv.conf</code>. Kubelet does not use the DNS settings defined in CoreDNS within the Kubernetes cluster, as CoreDNS handles DNS resolution for services within running Pods, not for the Kubelet's image-pulling process.</p>
<p>The configuration of the Container Network Interface (CNI) doesn't affect DNS resolution for Kubelet's image pulls. The CNI is responsible for Pod networking after the Pod is instantiated, not before.</p>

CC BY-SA 4.0
2024-08-27T11:50:19.350Z
2024-08-27T11:50:19.350Z
lostmarien
<ol>
<li>Kubelet uses the DNS settings defined in CoreDNS, not the
<code>/etc/resolv.conf</code> file on the node. CoreDNS is the DNS server for
the Kubernetes cluster, and it handles DNS resolution for all pods
and services within the cluster.</li>
<li>Yes, CNI plugin is responsible
for setting up the network interfaces in pods and configuring the
network namespace.</li>
</ol>

CC BY-SA 4.0
2024-08-25T19:44:12.213Z
2024-08-25T19:44:12.213Z
YassineLbk
<ol>
<li>Imagine I have a pod manifest where its image is in a private registry. How will Kubelet pull the image? Is it using /etc/resolv.conf or the DNS settings defined in CoreDNS in Kubernetes?</li>
<li>Does the configuration of CNI affect DNS resolution in any sense?</li>
</ol>

<kubernetes><dns>
How Kubelet resolves DNS requests before Pod instantiation?
badger
# How Kubelet resolves DNS requests before Pod instantiation?

(Asked by: username_0 on 2024-08-25)

1. Imagine I have a pod manifest where its image is in a private registry. How will Kubelet pull the image? Is it using /etc/resolv.conf or the DNS settings defined in CoreDNS in Kubernetes?
2. Does the configuration of CNI affect DNS resolution in any sense?

**Tags:** kubernetes, dns


---

## 2 answers

### Answer by username_1 on 2024-08-27. Score: 0

Before a Pod is instantiated, Kubelet needs to pull the container image, and for this, it relies on the host's DNS settings, typically found in `/etc/resolv.conf`. Kubelet does not use the DNS settings defined in CoreDNS within the Kubernetes cluster, as CoreDNS handles DNS resolution for services within running Pods, not for the Kubelet's image-pulling process.

The configuration of the Container Network Interface (CNI) doesn't affect DNS resolution for Kubelet's image pulls. The CNI is responsible for Pod networking after the Pod is instantiated, not before.


---

### Answer by username_2 on 2024-08-25. Score: 0

1. Kubelet uses the DNS settings defined in CoreDNS, not the
   `/etc/resolv.conf` file on the node. CoreDNS is the DNS server for
   the Kubernetes cluster, and it handles DNS resolution for all pods
   and services within the cluster.
2. Yes, CNI plugin is responsible
   for setting up the network interfaces in pods and configuring the
   network namespace.


---

