flaky-branch-26433
03/24/2023, 7:52 PMdomain-xx.local
and 10.2.17.21
is the vm (server1
running k3s.))
kubectl run -it --rm --restart=Never busybox --image=busybox:1.28 -- nslookup 10.2.17.21
Server: 192.168.246.10
Address 1: 192.168.246.10 kube-dns.kube-system.svc.domain-xx.local
Name: 10.2.17.21
Address 1: 10.2.17.21 server1.domain-xx.local
Lookup with IP is working ✅
Now I'm trying to resolve the same system via name:
kubectl run -it --rm --restart=Never busybox --image=busybox:1.28 -- nslookup server1.domain-xx.local
Server: 192.168.246.10
Address 1: 192.168.246.10 kube-dns.kube-system.svc.domain-xx.local
nslookup: can't resolve 'server1.domain-xx.local'
Lookup with name is not working. ❌
I'm new to k3s, so bear with me. It's a single k3s node, fresh installed. The host can resolve in both ways.
When I'm running: kubectl run -i --restart=Never --rm test-${RANDOM} --image=ubuntu --overrides='{"kind":"Pod", "apiVersion":"v1", "spec": {"dnsPolicy":"Default"}}' -- sh -c 'cat /etc/resolv.conf'
to check for the /etc/resolv.conf it shows me the correct entries for the search domain and our dns server.
kube-dns (coredns) is runnig and dns server is 192.168.246.10
pod:
coredns-597584b69b-9hspl 1/1 Running 1 (65m ago) 87m
svc:
kube-dns ClusterIP 192.168.246.10 <none> 53/UDP,53/TCP,9153/TCP 87m
polite-piano-74233
03/24/2023, 8:04 PMserver1.svc.namespace.domain-xx.local
?flaky-branch-26433
03/24/2023, 8:06 PMkubectl run -it --rm --restart=Never busybox --image=busybox:1.28 -- nslookup 10.2.17.20
Server: 192.168.246.10
Address 1: 192.168.246.10 kube-dns.kube-system.svc.domain-xx.local
Name: 10.2.17.20
Address 1: 10.2.17.20 code.domain-xx.local
creamy-pencil-82913
03/24/2023, 8:15 PMflaky-branch-26433
03/24/2023, 8:16 PMcreamy-pencil-82913
03/24/2023, 8:17 PMflaky-branch-26433
03/24/2023, 8:19 PMcreamy-pencil-82913
03/24/2023, 8:19 PMkube-dns.kube-system.svc.domain-xx.local
which was indicating that you’d replaced the cluster domain with domain-xx.local because that is NOT the default cluster domain.flaky-branch-26433
03/24/2023, 8:22 PMcreamy-pencil-82913
03/24/2023, 8:23 PMflaky-branch-26433
03/24/2023, 8:23 PMcreamy-pencil-82913
03/24/2023, 8:23 PMflaky-branch-26433
03/24/2023, 8:23 PMcreamy-pencil-82913
03/24/2023, 8:23 PMflaky-branch-26433
03/24/2023, 8:24 PMcreamy-pencil-82913
03/24/2023, 8:24 PMdid not specify any special domain in k3s installation.was not accurate
flaky-branch-26433
03/24/2023, 8:24 PMcreamy-pencil-82913
03/24/2023, 8:24 PMflaky-branch-26433
03/24/2023, 8:24 PMcreamy-pencil-82913
03/24/2023, 8:24 PMflaky-branch-26433
03/24/2023, 8:28 PMcreamy-pencil-82913
03/24/2023, 8:29 PMflaky-branch-26433
03/24/2023, 8:30 PMcreamy-pencil-82913
03/24/2023, 8:36 PM