Courseiva
Services and NetworkingeasyMultiple ChoiceObjective-mapped

CKA Services and Networking Practice Question

What is the default DNS name for a Service named 'my-service' in namespace 'my-ns'?

⚠ Common exam trap

The trap here is that candidates often forget the `.svc` subdomain or misplace it, leading them to choose options like A or B, but the correct order is always `<service>.<namespace>.svc.cluster.local`.

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

my-service.my-ns.svc.cluster.local

In Kubernetes, the default DNS name for a Service follows the pattern `<service-name>.<namespace>.svc.cluster.local`. This is defined by the cluster DNS specification (CoreDNS or kube-dns). For a Service named 'my-service' in namespace 'my-ns', the fully qualified domain name (FQDN) is `my-service.my-ns.svc.cluster.local`. The `.svc` subdomain is a fixed part of the DNS schema, distinguishing Services from other resource types like Pods.

Answer analysis

Option-by-option breakdown

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

  • my-service.my-ns.cluster.local

    Why it's wrong here

    This hostname omits the mandatory 'svc' subdomain. Kubernetes DNS records for Services are always nested under the 'svc' subdomain, regardless of whether the Service is ClusterIP, NodePort, or LoadBalancer. Without 'svc', the name does not correspond to any Service resource and will fail DNS resolution unless a custom record is manually created.

  • my-service.svc.my-ns.cluster.local

    Why it's wrong here

    Here the 'svc' subdomain appears before the namespace, which is the reverse of the required hierarchy. The FQDN must be constructed as service-name.namespace.svc.cluster.local, with 'svc' acting as a parent domain beneath the cluster domain and the namespace below it. This ordering is defined by the Kubernetes DNS specification, and any deviation will be unregistered and unresolvable.

  • my-service.cluster.local

    Why it's wrong here

    This name omits both the namespace and the 'svc' subdomain. The cluster.local prefix alone only identifies the cluster's root domain; you must specify the Service's namespace and the 'svc' label to form a resolvable FQDN. Even for Services in the 'default' namespace, the namespace component is still required in fully qualified form.

  • my-service.my-ns.svc.cluster.local

    Why this is correct

    This is the standard fully qualified domain name (FQDN) for a Kubernetes Service in the 'my-ns' namespace. The format '<service>.<namespace>.svc.cluster.local' is defined by the cluster's DNS specification, typically implemented by CoreDNS, and resolves to the Service's ClusterIP or to the pod IPs for headless Services. This FQDN works from any namespace within the cluster.

Go deeper

Related to this question

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.