DNS Design for Internal Services

Namespace choice, split-horizon, resolver behaviour and the caching pitfalls that make DNS look like an application bug.

Published Apr 21, 20269 min read5 views
  • dns
  • kubernetes
  • linux
  • networking

Choose a real domain

Use a subdomain of a domain you own — internal.example.com — never .local or an invented TLD. Reserved and squatted namespaces break certificate issuance, mDNS and, eventually, someone's laptop.

Split-horizon without surprises

View

Serves

Contains

internal

Corporate ranges and VPN

Private A/AAAA, service records

external

Everyone else

Public records only

Keep the record sets generated from one source of truth. Two hand-maintained zone files will diverge, and the divergence surfaces during an incident.

Resolver behaviour matters

Bash
resolvectl status
dig +trace api.internal.example.com
dig @10.10.10.53 api.internal.example.com +norecurse

Kubernetes and the cluster domain

CoreDNS owns cluster.local. Forward everything else to your internal resolvers explicitly, and enable the node-local cache when query volume grows.

text
.:53 {
    errors
    health
    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      ttl 30
    }
    forward . 10.10.10.53 10.10.10.54 {
      max_concurrent 1000
    }
    cache 30
    loop
    reload
}

Operational rules

  • Low TTLs before a migration, restored after — not permanently.

  • Monitor SERVFAIL rate and resolver latency, not just resolver uptime.

  • Never point production at a resolver running on the same host as the workload only.

Back to all docs