ExternalDNS: Automate DNS for Kubernetes Services
Every DevOps engineer knows the pain: deploy a new service, then manually update DNS records. ExternalDNS eliminates this entirely by automatically configuring DNS providers (Route53, CloudFlare, Google DNS) based on Kubernetes resources.
What ExternalDNS Does
ExternalDNS watches Kubernetes Services and Ingresses, then automatically creates DNS records in your provider. Deploy a LoadBalancer service with an annotation — DNS record appears in seconds.
apiVersion: v1
kind: Service
metadata:
name: my-app
annotations:
external-dns.alpha.kubernetes.io/hostname: app.example.com
spec:
type: LoadBalancer
ports:
- port: 80
selector:
app: my-app
The Free API (Kubernetes CRDs)
ExternalDNS uses Kubernetes-native CRDs as its API. You interact through standard kubectl commands:
# Check what DNS records ExternalDNS manages
kubectl get dnsendpoints -A
# Create a custom DNS record
cat <<EOF | kubectl apply -f -
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: custom-record
spec:
endpoints:
- dnsName: api.example.com
recordTTL: 300
recordType: A
targets:
- 1.2.3.4
EOF
Supported Providers (50+)
- AWS Route53 — most popular, supports alias records
- CloudFlare — free tier friendly, proxied records
- Google Cloud DNS — native GKE integration
- Azure DNS — works with AKS
- DigitalOcean — simple setup
- Infoblox, PowerDNS, CoreDNS — on-prem options
Real-World Use Case
A startup running 200 microservices on EKS was spending 2 hours daily on DNS updates. After deploying ExternalDNS with Route53, DNS updates became automatic. Zero manual work. Zero DNS drift.
Quick Start
helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
helm install external-dns external-dns/external-dns \
--set provider=aws \
--set policy=sync \
--set registry=txt \
--set txtOwnerId=my-cluster
Key Features
| Feature | Details |
|---|---|
| Providers | 50+ DNS providers |
| Sources | Services, Ingress, Istio, Contour, F5 |
| Policies | sync, upsert-only, create-only |
| Registry | TXT records for ownership tracking |
| Filtering | Namespace, annotation, domain filters |
Resources
Need automated data collection for your infrastructure monitoring? Check out my web scraping actors on Apify or email me at spinov001@gmail.com for custom DevOps automation solutions.
Top comments (0)