Courseiva
Services and Networking →mediumMultiple Choice

CKA Services and Networking Practice Question

A pod 'my-pod' in the 'default' namespace cannot resolve the service 'db-service' in the 'production' namespace. Which DNS name should be used to reach the service from 'my-pod'?

⚠ Common exam trap

Test-takers frequently assume the short service name works across namespaces or confuse the order of namespace and service in the FQDN, leading them to pick Option A or D, while Option C exploits the common misconception that pods use the same DNS suffix as services.

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

✓

db-service.production.svc.cluster.local

Kubernetes DNS resolves services across namespaces using the fully qualified domain name (FQDN) format `<service>.<namespace>.svc.cluster.local`. Since 'my-pod' is in the 'default' namespace and 'db-service' is in the 'production' namespace, the short name 'db-service' will not resolve; the FQDN must include the namespace and the cluster domain suffix to reach the service.

Answer analysis

Option-by-option breakdown

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

  • ✗

    db-service

    Why it's wrong here

    The unqualified name 'db-service' only resolves to a Service in the same namespace as the querying pod. Because the pod is in the default namespace, DNS search domains such as default.svc.cluster.local are appended, so 'db-service' becomes 'db-service.default.svc.cluster.local' — not the production Service. Without an explicit namespace, the production Service is completely unreachable via this short name.

  • ✓

    db-service.production.svc.cluster.local

    Why this is correct

    This is the fully qualified domain name (FQDN) for a Service in the production namespace, following the required Kubernetes DNS pattern: <service>.<namespace>.svc.<cluster-domain>. Since it is an absolute name with the 'svc' subdomain, it resolves to the ClusterIP of db-service regardless of the pod's namespace. The default cluster domain is 'cluster.local', so this name is valid and reachable from any namespace.

  • ✗

    db-service.production.pod.cluster.local

    Why it's wrong here

    The substring 'pod.cluster.local' indicates a Pod DNS name, not a Service DNS name. Kubernetes exposes Services under the 'svc.cluster.local' subdomain, while individual Pods have FQDNs like <hostname>.<namespace>.pod.cluster.local for headless Services or for Pods with hostNetwork. Using 'pod.cluster.local' for a Service will fail because no DNS record for 'db-service' exists in the 'production' namespace under that zone; Services are only registered under 'svc'.

  • ✗

    production.db-service.svc.cluster.local

    Why it's wrong here

    This reverses the DNS label order defined by Kubernetes. The canonical FQDN places the Service name first and the namespace second: <service>.<namespace>.svc.cluster.local. Here the name is parsed as a Service named 'production' in a namespace called 'db-service', which does not exist, so DNS resolution fails. The namespace must always follow the Service name in the FQDN, not precede it.

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

Courseiva writes every CKA question from scratch — 726 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.