Resolve names through cluster DNS

  • 12 min
  • 6 steps
  • Networking

Steps

0 of 6 done

Read a pod's resolver settings, resolve Services across namespaces and pods behind a headless Service, find CoreDNS's upstream, and cut the search-list walk.

  1. Step 1 of 6

    Find the nameserver, the search list and the ndots value that the toolbox pod in shop resolves names with.

    Checked against what your commands print.

  2. Step 2, not started: From toolbox, the name ledger does not resolve, although a ledger Service exists. Resolve it with the shortest name that works from shop.

  3. Step 3, not started: db in shop is a headless Service in front of a StatefulSet. Resolve the name that always points at the first replica, and only at it.

  4. Step 4, not started: Find where CoreDNS sends queries for names outside the cluster domain.

  5. Step 5, not started: List the pod addresses behind the cluster DNS Service. It keeps the name it had before CoreDNS existed.

  6. Step 6, not started: toolbox mostly calls external hosts such as api.example.com. Change its Deployment so that any name with two or more dots is tried as an absolute name first.

Lab terminal

Cluster time 1 minute
kind cluster kx, Kubernetes 1.37.
Each step is checked as you work.
​
Tab completes. Up and Down recall.
Type help for more.
Terminal keys

Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.