Courseiva
Services and Networking →easyMultiple Choice

CKA Services and Networking Practice Question

Which DNS record does CoreDNS create for a headless Service named 'headless-svc' in the namespace 'default'?

⚠ Common exam trap

Watch out — candidates often assume headless Services create no DNS records or that they use a ClusterIP-based A record, but CoreDNS actually creates A records for each pod IP, not for a virtual Service IP, which is a key distinction for stateful applications.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

A records for each pod IP backing the Service

CoreDNS creates A records for each pod IP backing a headless Service because headless Services (with clusterIP set to None) are designed to return pod IPs directly via DNS, rather than a single Service IP. For a headless Service named 'headless-svc' in the 'default' namespace, CoreDNS performs a DNS lookup that returns multiple A records, one for each ready pod endpoint, enabling direct pod-to-pod communication without load balancing.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    A records for each pod IP backing the Service

    Why this is correct

    When a Service is configured as headless by setting spec.clusterIP to None, CoreDNS bypasses the creation of a single virtual IP record. Instead, it directly generates individual A or AAAA records mapping the Service's fully qualified domain name to the IP addresses of all ready backend pods selected by the Service. This allows clients to perform direct peer-to-peer communication or implement custom client-side load balancing.

  • ✗

    No DNS record

    Why it's wrong here

    CoreDNS actively monitors the Kubernetes API for headless Services and populates DNS zones accordingly. Rather than ignoring these resources, CoreDNS creates a set of A records resolving to the individual IP addresses of the backing pods. Without these records, Kubernetes would lack native DNS-based service discovery for stateful applications like databases.

  • ✗

    A CNAME record pointing to an external DNS

    Why it's wrong here

    This behavior is characteristic of ExternalName type Services, not headless Services. For ExternalName Services, CoreDNS returns a CNAME record pointing to an arbitrary external domain specified in the spec.externalName field. Headless Services, by contrast, resolve to internal pod IPs within the cluster's overlay network rather than redirecting traffic to external hosts.

  • ✗

    An A record for the Service IP (ClusterIP)

    Why it's wrong here

    A headless Service explicitly defines spec.clusterIP as None, meaning Kubernetes does not allocate a virtual ClusterIP for it. Consequently, CoreDNS cannot create an A record pointing to a non-existent ClusterIP. Instead of routing traffic through a single virtual IP managed by kube-proxy, clients resolve the Service name directly to the individual backend pod IPs.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

Go deeper

Related to this question

About these practice questions

This CKA question is part of Courseiva's 726-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKA exam.