Kubernetes internal dns

I deployed rancher aws kubernetes. There seems to be no local kubernetes dns is configured on cluster.

I expected nslookup kubernetes from the pod to be resolved as kubernetes.default.svc.cluster.local
it is not resoved and none of service seems to get resolved…

is this expected behavior?

1 Like

I was about to open a topic about it. I want to understand how Rancher 2.0 DNS works. I still did not get it.

But I think is related to “xip.io

What is xip.io?
xip.io is a magic domain name that provides wildcard DNS
for any IP address. Say your LAN IP address is 10.0.0.1.
Using xip.io,

      10.0.0.1.xip.io   resolves to   10.0.0.1
  www.10.0.0.1.xip.io   resolves to   10.0.0.1

mysite.10.0.0.1.xip.io resolves to 10.0.0.1
foo.bar.10.0.0.1.xip.io resolves to 10.0.0.1

…and so on. You can use these domains to access virtual
hosts on your development web server from devices on your
local network, like iPads, iPhones, and other computers.
No configuration required!

How does it work?
xip.io runs a custom DNS server on the public Internet.
When your computer looks up a xip.io domain, the xip.io
DNS server extracts the IP address from the domain and
sends it back in the response.

Does xip.io cost anything?
Nope! xip.io is a free service from Basecamp, the
creators of Pow. We were tired of jumping through hoops
to test our apps on other devices and decided to solve
the problem once and for all.

See this too https://rancher.com/docs/rancher/v2.x/en/concepts/load-balancing/

“Host Names in Layer-7 Load Balancer”

“Some cloud-managed layer-7 load balancers (such as the ALB ingress controller on AWS) expose DNS addresses for ingress rules. You need to map (via CNAME) your domain name to the DNS address generated by the layer-7 load balancer.”

dope… my issue seems to be vpc and subnet issue…with cidr.
my vpc is 10.50.X.X and kubernetes picked “PodCIDR”: “10.42.0.0/24”.
When i do tracepath from pod to kube-dns and traffic is going out to vpc first and could not ping kubde-dns with cluster-ip.

is there a way to specify kubernetes to use specific subnet and cidr in rancher aws template?