World map

 

BM: Baca dalam Bahasa Melayu

World K3: Counters & Doors

Cluster DNS

You will learn: to call a Service by name, even in another namespace.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

You are here: cluster kind-dev namespace default
The client asks for http://menu. wget says: bad address 'menu'. Terminal output: $ kubectl exec client -- wget -qO- -T 5 http://menu wget: bad address 'menu' command terminated with exit code 1

The menu moved to the kitchen zone. Now the client gets bad address 'menu'. Plain words: that name means nothing in this zone.

Watch

Every Service gets a name in the cluster DNS: The food court's directory: turns a Service name like menu.kitchen into its address., the food court’s directory. Put the parts of the full name in order.

Left to right, top first. Put these in order. Use the arrows, or drag.

  • cluster.local (this cluster)
  • kitchen (its namespace)
  • svc (it is a Service)
  • menu (the Service)

Try it

Reach the menu from the client. Add its zone to the name.

You are here: cluster kind-dev namespace default
Stalls: 3. Trays: 2 (2 ready). Waiting for a stall: 0.
  • menu1/1 ready
dev-control-planeOpenManager

No trays here.

dev-workerOpen
  • menu·7w5wn
dev-worker2Open
  • client
Time: +0s (sped up)

Predict

A pod inside the kitchen zone calls http://menu. Does it work?

Pick one answer.

Check

The client lives in the zone default. Judge each address it uses.

Swipe right for good, left for needs work. Or use the buttons.

1 / 5http://shop
http://shop

You did it!

You can now call any Service by name, in any namespace.

Go deeper (optional)

The directory is CoreDNS: pods in kube-system behind the Service kube-dns at 10.96.0.10. A headless Service’s name returns each pod’s own IP. If names fail everywhere, check CoreDNS first.

Real rep (optional), on a throwaway kind cluster:

Real mission

  1. kubectl get pods -n kube-system -l k8s-app=kube-dns
  2. kubectl exec client -- cat /etc/resolv.conf
  3. kubectl exec client -- wget -qO- -T 5 http://shop.default.svc.cluster.local

0 of 3 steps done · Your ticks are saved.