Courseiva
Services and NetworkingmediumMultiple ChoiceObjective-mapped

CKA Services and Networking Practice Question

What is the DNS name for a Service named 'api' in the 'default' namespace?

⚠ Common exam trap

The trap here is that candidates often forget the `svc` subdomain or reverse the service/namespace order, because they may confuse the DNS format with other Kubernetes naming conventions (e.g., pod DNS or headless service records) or assume the namespace comes first.

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

api.default.svc.cluster.local

The correct DNS name for a Service in Kubernetes follows the pattern `<service-name>.<namespace>.svc.cluster.local`. For a Service named 'api' in the 'default' namespace, this resolves to `api.default.svc.cluster.local`. The `svc` subdomain is a fixed part of the cluster domain, and `cluster.local` is the default cluster domain suffix configured in kubelet and CoreDNS.

Answer analysis

Option-by-option breakdown

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

  • api.default.svc.cluster.local

    Why this is correct

    The Kubernetes DNS schema for a Service is <service-name>.<namespace>.svc.cluster.local. Since the Service is named 'api' and created in the default namespace, the fully qualified domain name becomes api.default.svc.cluster.local. This FQDN resolves to the Service's ClusterIP and enables reliable cluster-wide service discovery.

  • default.api.svc.cluster.local

    Why it's wrong here

    This reverses the expected resource and namespace ordering. In Kubernetes, the Service name is the leftmost label, followed by the namespace, so the correct form is service.namespace, not namespace.service. A query for default.api.svc.cluster.local would be interpreted as a Service named 'default' in the namespace 'api', which does not match the intended resources and would fail DNS resolution.

  • api.svc.default.cluster.local

    Why it's wrong here

    Here the 'svc' component is incorrectly inserted between the service name and the namespace. The valid structure is always <service>.<namespace>.svc, with 'svc' appearing after the namespace, not before it. Placing 'svc' between api and default breaks the canonical hierarchy, so this name neither matches the service nor conforms to Kubernetes DNS naming rules.

  • api.default.cluster.local

    Why it's wrong here

    This omits the 'svc' subdomain, which is a mandatory portion of the service DNS FQDN. The sequence '<service>.<namespace>.cluster.local' is not a standard record type; services live under the '<namespace>.svc' subdomain. Without 'svc', the DNS name is incomplete, and CoreDNS will not return the ClusterIP record for the api service.

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

One of 302 original CKA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.