Courseiva
Services and NetworkinghardMultiple ChoiceObjective-mapped

CKA Services and Networking Practice Question

You have a Deployment with 3 replicas. You create a headless service (clusterIP: None) with a label selector. Which of the following is true about DNS resolution for this service?

⚠ Common exam trap

Test-takers frequently assume all services have a ClusterIP and that DNS always returns a single IP, but headless services bypass this entirely, returning multiple pod IPs instead.

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

DNS returns the IP addresses of all pods that match the selector.

A headless service (clusterIP: None) does not allocate a ClusterIP. Instead, DNS returns the IP addresses of all pods matching the label selector via A/AAAA records. This allows direct pod-to-pod communication without load balancing, commonly used for stateful workloads like databases.

Answer analysis

Option-by-option breakdown

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

  • DNS returns the IP addresses of all pods that match the selector.

    Why this is correct

    With a headless service (clusterIP: None), the DNS name for the service is not backed by a virtual IP. Instead, CoreDNS/kube-dns creates an A record for each ready pod endpoint that matches the service's selector, so a DNS query for the service name returns the IP addresses of all 3 pod replicas.

  • DNS does not resolve the service name at all.

    Why it's wrong here

    The service name definitely resolves; a headless service still has a DNS entry in the cluster, so a lookup will never return NXDOMAIN. The distinction is simply that the response is a list of pod IP addresses rather than a single ClusterIP, meaning discovery works, just with multiple A records.

  • DNS returns the service name as a CNAME to the pod names.

    Why it's wrong here

    CNAME behavior is reserved for ExternalName services that alias an external DNS name; a headless service does not generate a CNAME record. The pod-specific names used by StatefulSets still point to actual pod IPs via A records, and the service name itself returns multiple A records, never a CNAME indirection.

  • DNS resolves the service name to a single ClusterIP.

    Why it's wrong here

    Because a headless service explicitly sets clusterIP: None, it has no ClusterIP allocated, and its DNS records never include such a virtual IP. A normal ClusterIP service would indeed resolve to a single service IP, but for this deployment's headless service, the lookup returns all matching pod addresses instead.

Visual reference

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

About these practice questions

This CKA question is part of Courseiva's 302-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.