Pods are not recognizing local domains (returning Unknown host)

Issue:

Local domains are not resolved inside the Kubernetes pods.

Error: Unknown host

 

Resolution:

Adding the local DNS server(s) to CoreDNS.

 

The CoreDNS addon for MicroK8s handles address resolution services to Kubernetes.

By default, it points to Google’s 8.8.8.8 and 8.8.4.4 servers for resolving addresses.

This can be changed by running the command:

microk8s kubectl -n kube-system edit configmap/coredns

This will open the vim editor, where you can edit the configuration.

dns1.jpg

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.