Courseiva
Services and Networking →easyMultiple Choice

CKA Services and Networking Practice Question

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

⚠ Common exam trap

The trap here is that candidates often forget the 'svc' subdomain or the namespace component, mistakenly thinking the Service name alone (e.g., 'my-svc.cluster.local') or just the namespace (e.g., 'my-svc.my-ns.cluster.local') is sufficient, while Kubernetes strictly requires the full `<service>.<namespace>.svc.cluster.local` format for cross-namespace DNS 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

✓

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

Kubernetes constructs the default DNS name for a Service using the format `<service-name>.<namespace>.svc.cluster.local`. This is defined by the cluster DNS specification (CoreDNS or kube-dns) and allows Pods to resolve the Service by its fully qualified domain name (FQDN) within the cluster. For 'my-svc' in namespace 'my-ns', the FQDN is 'my-svc.my-ns.svc.cluster.local'.

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-svc.my-ns.svc.cluster.local

    Why this is correct

    This is the canonical Kubernetes Service Fully Qualified Domain Name (FQDN). The layout is <service-name>.<namespace>.svc.<cluster-domain>, and for a service named my-svc in namespace my-ns, the default cluster domain cluster.local yields my-svc.my-ns.svc.cluster.local. This record is dynamically maintained by CoreDNS and resolves to the service's ClusterIP, allowing deterministic internal access for workloads in any namespace.

  • ✗

    my-svc.svc.cluster.local

    Why it's wrong here

    Omitting the namespace is invalid for a Service FQDN because the namespace is a mandatory second left-most label in the DNS name. A query for my-svc.svc.cluster.local is interpreted as a Service named my-svc in an empty or nonexistent namespace context, and Kubernetes DNS never registers records without a namespace segment. Without that segment, the resolver cannot disambiguate which namespace's my-svc Service is requested, so the lookup fails with NXDOMAIN.

  • ✗

    my-svc.my-ns.cluster.local

    Why it's wrong here

    The literal label 'svc' is not a placeholder but a fixed subdomain under the namespace that hosts all Kubernetes Service records. Removing it to produce my-svc.my-ns.cluster.local places the query one level high in the DNS hierarchy, and no wildcard or prefix record exists to match that name. Since the name lies outside the service DNS subtree, CoreDNS will not find an A/AAAA record for it, even if a Service named my-svc exists in the my-ns namespace.

  • ✗

    my-svc.cluster.local

    Why it's wrong here

    This name drops both the namespace and the svc component, placing my-svc at the cluster root, where only cluster-level records—such as the CoreDNS service itself—may live. Kubernetes has no mechanism to register Service names directly under <service-name>.cluster.local; every Service is scoped exactly one namespace deep. Even if a Service were in the default namespace, the correct name is my-svc.default.svc.cluster.local, not my-svc.cluster.local, so this lookup can never match any Service object.

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 726 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.