Courseiva
Container Orchestration →mediumMultiple Choice

KCNA Container Orchestration Practice Question

You create a Service of type ClusterIP with the name 'my-service' in the 'default' namespace. What DNS name resolves to the service's cluster IP from a pod in the same namespace?

⚠ Common exam trap

The trap here is that candidates often forget the mandatory 'svc' subdomain in the FQDN, mistakenly thinking the namespace directly precedes 'cluster.local', or they omit the namespace entirely when the Service is in the same namespace as the pod.

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

Kubernetes DNS resolves a Service's ClusterIP using the fully qualified domain name (FQDN) format `<service>.<namespace>.svc.cluster.local`. Since the Service 'my-service' is in the 'default' namespace, a pod in the same namespace can reach it via `my-service.default.svc.cluster.local`. The DNS query returns the ClusterIP of the Service, allowing pods to communicate with it reliably.

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

    Why this is correct

    Kubernetes DNS resolves Services as <service>.<namespace>.svc.cluster.local. With the Service named my-service in the default namespace, that fully qualified name resolves to its cluster IP, and the shorter form my-service also works from within the same namespace.

  • ✗

    my-service.svc.cluster.local

    Why it's wrong here

    This is the fully qualified name, not the short form. From a pod in the same namespace, the bare service name my-service resolves via the search path; the FQDN is required only from other namespaces. The question asks what resolves in-namespace.

  • ✗

    my-service.default.cluster.local

    Why it's wrong here

    The svc label is mandatory in the fully qualified form; dropping it produces a name with no matching DNS record. It looks like a plausible namespace-qualified variant, but the correct FQDN inserts svc between the namespace and cluster.local.

  • ✗

    my-service.cluster.local

    Why it's wrong here

    The cluster domain suffix is cluster.local, but a bare service name must sit between the service and that suffix; omitting the namespace and svc labels yields a name Kubernetes does not publish. It resembles the short-form search path, yet only my-service alone resolves in-namespace.

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 KCNA question from scratch — 930 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

Same concept, more angles

1 more way this is tested on KCNA

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A Service of type ClusterIP is created for a Deployment, but Pods in other namespaces cannot reach it. What is the most likely cause?

hard
  • A.NetworkPolicies are blocking cross-namespace traffic
  • ✓ B.The Pods in other namespaces are using the short Service name without the namespace suffix
  • C.The Service is not publishing the correct port
  • D.The Service selector does not match the Pod labels

Why B: The most likely cause is that Pods in other namespaces are using the short Service name (e.g., `my-service`) without appending the namespace suffix (e.g., `my-service.other-namespace.svc.cluster.local`). Kubernetes DNS resolves short names only within the same namespace; cross-namespace resolution requires the fully qualified domain name (FQDN) or at least the `<service>.<namespace>.svc` form. Without this, the DNS lookup fails, making the Service unreachable from other namespaces.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This KCNA 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 KCNA exam.