πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Networking intermediate ⏱ 15 minutes K8s 1.28+

External DNS for Kubernetes: Setup Guide

Automate DNS record management with ExternalDNS for Kubernetes. Sync Service and Ingress hostnames to Route53, CloudFlare, Google Cloud DNS, and 30+ providers.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: networking

The Problem

Engineers need production-ready guides for these essential Kubernetes ecosystem tools. Incomplete documentation leads to misconfiguration and security gaps.

The Solution

Install ExternalDNS

helm repo add external-dns https://kubernetes-sigs.github.io/external-dns
helm install external-dns external-dns/external-dns \
  --namespace external-dns --create-namespace \
  --set provider.name=aws \
  --set env[0].name=AWS_DEFAULT_REGION \
  --set env[0].value=eu-west-1 \
  --set policy=sync \
  --set domainFilters[0]=example.com

How It Works

# Create a Service or Ingress with a hostname annotation
apiVersion: v1
kind: Service
metadata:
  name: web
  annotations:
    external-dns.alpha.kubernetes.io/hostname: app.example.com
    external-dns.alpha.kubernetes.io/ttl: "300"
spec:
  type: LoadBalancer
  selector:
    app: web
  ports:
    - port: 80
# ExternalDNS automatically creates:
# app.example.com β†’ A record β†’ LoadBalancer IP

Works with Ingress Too

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web-ingress
spec:
  rules:
    - host: app.example.com     # ExternalDNS picks this up automatically
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web
                port:
                  number: 80

Provider Configuration

ProviderHelm valueAuth
AWS Route53provider.name=awsIAM role / IRSA
Cloudflareprovider.name=cloudflareAPI token
Google Cloud DNSprovider.name=googleService account
Azure DNSprovider.name=azureManaged identity
DigitalOceanprovider.name=digitaloceanAPI token

Policies

PolicyBehavior
syncCreate + update + delete records
upsert-onlyCreate + update, never delete
create-onlyOnly create new records
graph LR
    A[Service/Ingress with hostname] --> B[ExternalDNS watches]
    B --> C{DNS Provider}
    C --> D[Route53]
    C --> E[Cloudflare]
    C --> F[Google DNS]
    G[Service deleted] --> B
    B -->|policy=sync| H[DNS record deleted]

Frequently Asked Questions

Will ExternalDNS delete my manually created records?

With policy=sync, it manages records it created (tracked via TXT ownership records). It won’t touch records created outside ExternalDNS. Use upsert-only for extra safety.

Best Practices

  • Start with default configurations and customize as needed
  • Test in a non-production cluster first
  • Monitor resource usage after deployment
  • Keep components updated for security patches

Key Takeaways

  • This tool fills a critical gap in the Kubernetes ecosystem
  • Follow the principle of least privilege for all configurations
  • Automate where possible to reduce manual errors
  • Monitor and alert on operational metrics
#external-dns #dns #route53 #cloudflare #automation
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens