Opscraft
Route 53 hosted zones · Lesson 6 of 8 · 3 min read

EKS and Route 53

How pods resolve names

Pods query CoreDNS (the kube-dns Service). CoreDNS answers *.cluster.local itself and forwards everything else to the VPC resolver (via the node's /etc/resolv.conf). So pods see:

  • Kubernetes Service names,
  • private hosted zone records associated with the cluster's VPC,
  • interface endpoint private DNS,
  • public DNS.

To resolve on-prem names from pods, either rely on Resolver forwarding rules associated with the VPC (preferred — works for nodes too) or add a CoreDNS server block forwarding that domain.

Test from inside the cluster:

kubectl run -it --rm dnstest --image=busybox:1.36 --restart=Never -- nslookup orders-db.internal.example.com
kubectl run -it --rm dnstest --image=nicolaka/netshoot --restart=Never -- dig +search orders-db.internal.example.com
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=50
Enlarge diagrampod asks for orders-db.internal.example.comCoreDNSnot under cluster.local, so forward itVPC resolver (.2)the private zone is associated with this VPCanswerCNAME to the RDS endpoint
Figure 1. How a pod in EKS reaches a private hosted zone name: CoreDNS forwards anything outside cluster.local to the VPC resolver, which knows the private zones.
Swipe sideways to see all of it, or tap to open it full screen.

External DNS

External DNS watches Ingresses and Services and creates Route 53 records automatically:

Enlarge diagramIngresswith a hostnameAWS LBControllercreates the ALBExternal DNSwatcheshostnamesRoute 53alias shop → ALB,plus a TXTownership record
Figure 2. External DNS keeps Route 53 in step with the cluster: create an Ingress with a hostname and the record appears; delete it and the record goes.
Swipe sideways to see all of it, or tap to open it full screen.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: orders
  annotations:
    external-dns.alpha.kubernetes.io/hostname: orders.example.com
    alb.ingress.kubernetes.io/scheme: internet-facing
spec:
  ingressClassName: alb
  rules:
  - host: orders.example.com
    http: { paths: [{ path: /, pathType: Prefix, backend: { service: { name: orders, port: { number: 80 } } } }] }

Key settings:

  • Runs with an IAM role via IRSA/Pod Identity allowing route53:ChangeResourceRecordSets on specific hosted zone ARNs and route53:ListHostedZones/ListResourceRecordSets.
  • --domain-filter=example.com and --zone-id-filter to limit scope; --policy=upsert-only to never delete records (safer), or sync to remove stale ones.
  • --txt-owner-id=<cluster-name> — External DNS writes TXT ownership records so multiple clusters don't fight over the same records.
  • Works for both public and private zones (--aws-zone-type=private).

For 50 microservices, External DNS plus GitOps-managed Ingress manifests means DNS follows deployments automatically and is reviewed through Git.