Coredns Issue on Kubernetes Cluster

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.30.6
Cloud being used: bare-metal
Installation method: Kubeadm
Host OS: Ubuntu 20.0
CNI and version: Weave-net
CRI and version: Containerd - 1.6.31

Coredns pod intermittently sending domain name resolution requests to Google dns server 8.8.8.8 instead of the DNS server configured in /etc/resolv.conf. We checked the coredns configmap to check the forwarder config and it is having /etc/resolv.conf file. Most of the times it sends the request to the dns server configured in /etc/resolv.conf but intermittently it sends to 8.8.8.8 and hence the domain names configured privately gets NXDOMAIN error. We captured packets on the nodes and found out that the requests are intermittently being sent to 8.8.8.8 dns server.

Maybe it have local cache exists when you changed /etc/resolv.conf of the host, Advice you can restart as follow.

  1. kubelet
  2. coredns