External DNS
ExternalDNS is a Kubernetes controller that automatically manages DNS records for your cluster's services and ingresses. It acts as a bridge between Kubernetes resources and DNS providers like AWS Route 53, ensuring your DNS records stay synchronized with your cluster's state. Using DNS entries for your load balancers provides human-readable, memorable addresses instead of auto-generated host names, making your services easily accessible and recognizable as your corporate resources with domain names that align with your organization's branding
In this lab we'll automate DNS management for Kubernetes Ingress resources using ExternalDNS with AWS Route 53.
First let's install ExternalDNS using Helm, with the IAM role ARN and Helm chart version provided as environment variables:
Check that the ExternalDNS pod is running:
NAME READY STATUS RESTARTS AGE
external-dns-5bdb4478b-fl48s 1/1 Running 0 2m
Now let's update our previous Ingress resource with DNS configuration:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ui
namespace: ui
annotations:
external-dns.alpha.kubernetes.io/hostname: ui.retailstore.com
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/healthcheck-path: /actuator/health/liveness
spec:
ingressClassName: alb
rules:
- host: ui.retailstore.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ui
port:
number: 80
The annotation external-dns.alpha.kubernetes.io/hostname
tells ExternalDNS which DNS name to create and manage for the Ingress, automating the mapping of your app’s hostname to its load balancer.
The spec.rules.host
defines the domain name your Ingress will listen to, which ExternalDNS uses to create a matching DNS record for the associated load balancer.
Apply this configuration:
Let's inspect the Ingress object created with host name:
NAME CLASS HOSTS ADDRESS PORTS AGE
ui alb ui.retailstore.com k8s-ui-ui-1268651632.us-west-2.elb.amazonaws.com 80 4m15s
Verifying DNS record creation, ExternalDNS will automatically create the DNS record in the retailstore.com
Route 53 private hosted zone.
It can take several minutes for the DNS entries to be reconciled.
Check ExternalDNS logs to confirm DNS record creation:
Desired change: CREATE ui.retailstore.com A
5 record(s) were successfully updated
You can also verify the new DNS record in the AWS Route 53 console by clicking the link and navigating to the retailstore.com
private hosted zone:

Route 53 private hosted zones are only accessible from associated VPCs, in this case the EKS cluster VPC. To test the DNS entry we'll use curl
from inside a pod:
HTTP/1.1 200 OK
Date: Thu, 24 Apr 2025 07:45:12 GMT
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 15
Connection: keep-alive
Set-Cookie: SESSIONID=c3f13e02-4ff3-40ba-866e-c777f7450997
{"status":"UP"}