Skip to content

Containers can't resolve hostnames #6168

Answered by Mudrock1776
Mudrock1776 asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution to this problem. If I configure the coreDNS configmap to forward to google's name server (8.8.8.8), the DNS is now able to resolve hostnames. To do this you can edit the configmap with:

kubectl edit configmap -n kube-system rke2-coredns-rke2-coredns

and you want to change the data to look something like this

Corefile:
----
.:53 {
    errors 
    health  {
        lameduck 5s
    }
    ready 
    kubernetes   cluster.local  cluster.local in-addr.arpa ip6.arpa {
        pods insecure
        fallthrough in-addr.arpa ip6.arpa
        ttl 30
    }
    prometheus   0.0.0.0:9153
    forward   . 8.8.8.8
    cache   30
    loop 
    reload 
    loadbalance 
}

mostly just chan…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brandond
Comment options

Answer selected by Mudrock1776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants