-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
coredns forward . /etc/resolv.conf not working #4087
Comments
K3s validates the host's resolv.conf to ensure it doesn't contain any multicast or ipv6 upstream DNS servers. If it does, it will generate a replacement resolv.conf that points at 8.8.8.8. If you want to provide your own resolv.conf, you can point K3s at one with the |
Ah I see - I thought I am going crazy... Indeed I double checked that the So there is no way to make coredns to use Where do I put |
You can re-run the install script with that flag added as shown here: https://rancher.com/docs/k3s/latest/en/installation/install-options/how-to-flags/#example-b-install-k3s-exec Or simply edit the systemd unit and then reload/restart k3s. |
Thank you! I've found related issue coredns/coredns#2087 and seems like the answer is - no, coredns does not support |
Environmental Info:
K3s Version:
Node(s) CPU architecture, OS, and Version:
Linux lima-default 5.11.0-36-generic #40-Ubuntu SMP Fri Sep 17 18:15:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
curl -sfL https://get.k3s.io | sh -
from a Lima default Ubuntu VM.Describe the bug:
I have a private DNS I need to use, and on my Ubuntu host I've configured it with
resolvectl dns eth0 x.x.x.x y.y.y.y
. My pods in k3s however doesn't seem to get to these servers and they are using something else. I verified my Corefile is:So if I read it correctly -
forward . /etc/resolv.conf
line means coredns should use resolver from the host. My/etc/resolv.conf
on the host is pointing to thesystemd-resolved
and if I take anameserver
from there and try todig
/nslookup
using that server both on the host and inside a pod - it resolves correctly. My suspicion that k3s actually sits in between coredns and the host, or maybe I need to use other thaneth0
interface to set DNS?cni0
interface doesn't work either.Steps To Reproduce:
curl -sfL https://get.k3s.io | sh -
systemd-resolved
to use a private DNSExpected behavior:
Pod should be able to resolve private address.
Actual behavior:
Not resolving.
Additional context / logs:
Backporting
The text was updated successfully, but these errors were encountered: