Courseiva
Services and NetworkingmediumMultiple ChoiceObjective-mapped

CKA Services and Networking Practice Question

You have a headless service named 'my-headless' with clusterIP: None. A pod in the same namespace queries the DNS name 'my-headless'. What will the DNS response contain?

⚠ Common exam trap

Watch out — candidates often confuse headless services with normal ClusterIP services, assuming DNS will return a single virtual IP or an error, rather than understanding that headless services return multiple pod IPs for direct pod-to-pod resolution.

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 list of A records for each pod matching the service selector.

A headless service (clusterIP: None) does not have a ClusterIP or load-balance traffic. Instead, DNS queries for the service name return A records for the individual pod IPs that match the service's selector. This allows direct pod-to-pod communication without a proxy, as defined by Kubernetes DNS specification.

Answer analysis

Option-by-option breakdown

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

  • An error because headless services cannot be queried by DNS.

    Why it's wrong here

    It is not an error. Kubernetes' internal DNS (CoreDNS by default) resolves all Service names, including headless Services. For a headless Service with a selector, a DNS query returns the set of pod IPs as multiple A records rather than failing; therefore the query is valid and produces useful endpoint discovery data.

  • A single A record with the service's IP.

    Why it's wrong here

    This confuses ClusterIP Services with headless Services. A standard Service gets a virtual ClusterIP and DNS returns a single A record pointing to that IP, but a headless Service sets clusterIP: None, so no Service-level IP exists to return. Instead, DNS supplies the individual pod IPs that match the selector as separate A records.

  • The ClusterIP of the service (which is None).

    Why it's wrong here

    clusterIP: None is a configuration marker, not a routable address: it instructs CoreDNS to bypass the Service proxy and publish endpoint IPs directly. The value None is never carried in or returned by DNS. A DNS lookup for this headless Service will contain the A records of the selected pods, never a record with the literal string None or a ClusterIP address.

  • A list of A records for each pod matching the service selector.

    Why this is correct

    A headless Service with a selector creates Endpoints (or EndpointSlices) from the ready pods that match the labels. When a client looks up this Service name, CoreDNS returns one A record for each such pod IP, allowing direct pod discovery. This behavior is fundamental to StatefulSets, where each pod gets its own DNS name from this list.

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

Courseiva writes every CKA question from scratch — 302 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.