# CoreDNS not configuring nameservers

**URL:** <https://forums.suse.com/t/coredns-not-configuring-nameservers/19107>\
**Category:** SUSE Rancher Prime\
**Created:** [December 23, 2020, 8:33pm UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107 "2020-12-23T20:33:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverfractal852](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/silverfractal852/32/6973_2.png) [@silverfractal852](https://forums.suse.com/u/silverfractal852)\
**Post date:** [December 23, 2020, 8:33pm UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107/1 "2020-12-23T20:33:27Z")

</div>

I am using rke 1.2.4 to create my cluster. My pods’ /etc/resolv.conf is configured with a DNS server that matches the DNS server that was automatically filled in when I ran rke setup. However, I realized that the pods can’t resolve external hostnames using this entry and I need to add another nameerver in the pods (notably, 8.8.8.8). From the documentation on Rancher’s website on “Configuring CoreDNS”, the pod should pick up the namesevers configured on the host. I modifed /etc/resolv.conf on the host (both worker and master nodes), recreated my pod (actually deployment), went inside the pod and checked if ts /etc/resolv.confi was updated. It was not. I see one other option, which is to add an upstreamnameserver section in cluster.yml but I have not tried it (I’m worried about any inadvertant side effects, if any).

My question is, if I updated the hosts /etc/resolv.conf, why isn’t CoreDNS using it to resolve external queries?

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [December 23, 2020, 9:39pm UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107/2 "2020-12-23T21:39:31Z")

</div>

This change requires a kubelet restart (if you used `vi` to edit the file).

---

<div class="post-metadata">

**Author:** ![silverfractal852](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/silverfractal852/32/6973_2.png) [@silverfractal852](https://forums.suse.com/u/silverfractal852)\
**Post date:** [December 23, 2020, 11:06pm UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107/3 "2020-12-23T23:06:37Z")

</div>

It’s not clear to me how to restart a kublet. I’ve been going through the docs and out on the Internet. Because everything is running as a docker container, is it sufficient to just get the container ID and restart it? I saw something about draining a node. Should I drain a node first?

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [December 24, 2020, 12:15pm UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107/4 "2020-12-24T12:15:10Z")

</div>

RKE will only restart components if settings have changed, if you want to manually restart components, cordoning and draining a node before is the best option, after that you can reboot the node or just the kubelet (`docker restart kubelet`)

---

<div class="post-metadata">

**Author:** ![silverfractal852](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/silverfractal852/32/6973_2.png) [@silverfractal852](https://forums.suse.com/u/silverfractal852)\
**Post date:** [December 29, 2020, 12:17am UTC](https://forums.suse.com/t/coredns-not-configuring-nameservers/19107/5 "2020-12-29T00:17:34Z")

</div>

Thank you for getting back to me. I tried it and it worked.
