CKA Services and Networking Practice Question
Which annotation is commonly used with ExternalDNS to specify the DNS hostname for a Service?
⚠ Common exam trap
It's easy for candidates to confuse the `external-dns.alpha.kubernetes.io/hostname` annotation with the similar-sounding but non-existent `dns.alpha.kubernetes.io/hostname`, or they mistakenly associate `service.beta.kubernetes.io/load-balancer-dns` with DNS hostname configuration, when in fact it is not a real annotation in Kubernetes.
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
✓
external-dns.alpha.kubernetes.io/hostname
`external-dns.alpha.kubernetes.io/hostname` is the annotation used by the ExternalDNS project to specify the desired DNS hostname for a Kubernetes Service or Ingress. ExternalDNS watches resources with this annotation and synchronizes the DNS records (e.g., A or CNAME) with a configured DNS provider like AWS Route53 or Google Cloud DNS.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
service.beta.kubernetes.io/load-balancer-dns
Why it's wrong here
This legacy annotation is part of the cloud-controller-manager's Service controller, where certain providers (such as AWS) use it to assign an automatically generated DNS hostname to a load balancer. ExternalDNS does not read this key; it only watches for annotations under its own external-dns.alpha.kubernetes.io prefix, so this annotation has no effect on ExternalDNS record creation.
- ✓
external-dns.alpha.kubernetes.io/hostname
Why this is correct
This is the canonical annotation ExternalDNS watches on Services and Ingresses. Its value is a comma-separated list of DNS names that ExternalDNS will provision records for, using the resource's external IP or hostname as the target. The alpha segment of the prefix signals that the annotation's schema may evolve, but this key remains the standard way to explicitly request a DNS record.
- ✗
dns.alpha.kubernetes.io/hostname
Why it's wrong here
This annotation is incorrect because it is missing the external-dns namespace before alpha.kubernetes.io. ExternalDNS exclusively recognizes annotations that begin with external-dns.alpha.kubernetes.io; a bare dns.alpha.kubernetes.io prefix is not part of its API and will be silently ignored, leaving no DNS record created.
- ✗
kubernetes.io/ingress.class
Why it's wrong here
The kubernetes.io/ingress.class annotation selects which Ingress controller (nginx, traefik, etc.) should process an Ingress resource. While ExternalDNS may optionally filter Ingresses by this class, the annotation does not provide a target hostname; without the external-dns.alpha.kubernetes.io/hostname annotation, ExternalDNS will not know what DNS name to create.
Visual reference
Go deeper
Related to this question
Learn chapter
Kubernetes Architecture Overview
Key term
Ingress Resources
Ingress Resources are Kubernetes API objects that manage external access to services inside a cluster, typically HTTP and HTTPS traffic, by defining rules for routing requests based on hostnames and paths.
Key term
Network Policies
A Kubernetes resource that controls how pods communicate with each other and with other network endpoints, acting as a firewall for pod-to-pod traffic.
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 →
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.