Skip to main content
This guide inspects the DNS implementation running in a Kubernetes cluster (kube-system namespace) and answers the following:
  • Which DNS solution is implemented?
  • How many DNS server pods are deployed?
  • What Service name exposes CoreDNS?
  • What is the Service ClusterIP used by pods for DNS lookups?
  • Where is the CoreDNS configuration stored and how is it mounted into the pods?

1. Set a kubectl alias and list kube-system pods

Use a short alias for kubectl to speed up commands:
Example output:
Interpretation:
  • DNS implementation: CoreDNS (pods named coredns-*).
  • Number of CoreDNS pods: 2.

2. Find the Kubernetes Service for DNS

List Services in the kube-system namespace to locate the DNS Service:
Example relevant line (truncated):
From this:
  • Service name exposing CoreDNS: kube-dns
  • Service ClusterIP (used by pods): 10.96.0.10

3. Inspect a CoreDNS pod to find the Corefile and mounts

Describe one of the CoreDNS pods to inspect container arguments, mounts, and volumes:
Relevant excerpts from the describe output:
Key findings:
  • CoreDNS reads its configuration from /etc/coredns/Corefile (see -conf /etc/coredns/Corefile).
  • The /etc.coredns directory is mounted from a volume named config-volume.
  • config-volume is a ConfigMap volume sourced from the coredns ConfigMap.
CoreDNS configuration (the Corefile) is typically stored in the coredns ConfigMap in the kube-system namespace and volume-mounted into the CoreDNS pods at /etc/coredns/Corefile. You can inspect it with kubectl get configmap coredns -n kube-system -o yaml.

4. Quick reference — answers

Tip: If you need to edit the CoreDNS Corefile, update the coredns ConfigMap and then restart the CoreDNS pods (or let the Deployment/DaemonSet roll them) so the new Corefile is picked up.

Watch Video