Skip to content

DNS anycast — strategy and operating model

Why DNS authoritative is the canonical anycast workload, how to announce the same IP from many sites, and the operational practices that keep an anycast pool healthy.

A single DNS server, no matter how well provisioned, is a single point of failure with one network latency profile. Anycast solves both — announce the same IP from many sites and let BGP route each client to the topologically nearest one. DNS authoritative is the textbook anycast workload because each query is independent and idempotent. This article is the strategy and operating-model overview: how to think about anycast for DNS, what to announce, how to handle failure, and what to monitor.

How to verify

Before designing anycast, confirm whether the current zone is already anycast and where it answers from. A few commands and a couple of looking-glasses:

dig @ns1.example.com example.com SOA +nsid          # NSID identifies the responder
dig @ns1.example.com CHAOS TXT hostname.bind        # legacy hostname identifier
dig @ns1.example.com CHAOS TXT id.server            # modern identifier
mtr -n -c 5 ns1.example.com
# Then from a different region:
ssh tokyo-host dig @ns1.example.com example.com SOA +nsid

If different vantage points return different NSID strings (pop-fra, pop-iad, pop-sin), the name is anycast. If they all return the same NSID or none, it is unicast.

What’s happening

Anycast is a routing-layer construct, not a DNS one. Multiple servers (at different sites, with different upstream ISPs) announce the same prefix into BGP. Each transit / peering router picks one path based on standard BGP policy (path length, MED, local preference, etc.). Clients sending packets to that prefix end up at whichever server is “closest” in BGP terms — which usually correlates with geographic proximity but is fundamentally about network topology.

Why DNS authoritative is ideal:

  1. Stateless transactions. Each query is a single UDP exchange (or short TCP). The server does not care about session continuity, so a routing change mid-traffic just sends the next query elsewhere.
  2. Idempotent queries. Asking the same question of two anycast members gives the same answer (assuming the zones are in sync — and they should be).
  3. Tiny request size. A DNS query is tens of bytes; the response is hundreds. Anycast PoPs do not need huge capacity per location.

Compare to TCP web traffic: a mid-flow routing change kills the session. That is why HTTP anycast either uses very stable routing (Cloudflare-style careful BGP) or relies on the application tolerating reconnects.

Strategy: what to announce

Two architectural patterns for DNS anycast:

Single-pool anycast. All authoritative servers (ns1.example.com, ns2.example.com) live in the same anycast pool. Every NS record points at a single IP that resolves to every PoP. Simplest model; one IP, one NS name.

Multi-pool anycast. Multiple NS records, each backed by an independent anycast pool. ns1.example.com is one anycast group, ns2.example.com is a separate one. The benefit: a global routing fault in one pool does not take down DNS for the zone, because resolvers fail over to the other NS record. The cost: managing two routing infrastructures.

For most production deployments, multi-pool anycast is the right choice. Resolvers retry across NS records aggressively, so two independent anycast clouds give you a much stronger availability guarantee than a single cloud with internal redundancy.

The decision tree

  1. Do I need anycast? If your DNS clients are concentrated in one region, no — a unicast pair is simpler and cheaper. If they are global, yes.
  2. Build or buy? Running your own anycast requires BGP relationships, an ASN, and PoPs with carrier-neutral diversity. Most teams should buy from a managed authoritative DNS provider (NS1, Dyn, Route 53, PCH-backed offerings). Building makes sense at scale or for very specific operational requirements.
  3. One pool or two? As above — multi-pool gives you a much stronger availability story.
  4. Which authoritative software? NSD or Knot for very-high-QPS workloads where you serve a small set of zones. PowerDNS or BIND if you need backend integration or advanced policy.

Operational notes

  • Route Health Injection. A daemon (usually BIRD or FRR) on each PoP runs a health check against the local DNS server. If the check fails, the daemon withdraws the BGP announcement and traffic migrates to other PoPs. Without RHI, a dead PoP keeps drawing traffic until BGP timers expire — minutes of partial outage.
  • Withdrawal hysteresis. A flapping health check causes BGP flap, which is bad for the global table. Most teams add hysteresis: withdraw fast, re-announce slowly. Typical: withdraw after 2 consecutive failures, re-announce only after 30 consecutive successes.
  • Zone sync across PoPs. Every PoP must have the same zone. Use IXFR with a hidden primary; monitor SOA serial parity across all PoPs and alert on divergence.
  • Per-PoP measurement. Standard SLO monitoring against the anycast IP only tells you “DNS works.” Run per-PoP probes (querying each unicast loopback address) to detect a single sick PoP that is still in rotation.
  • BGP community tagging. When announcing from many PoPs, tag the routes with location communities. Upstream networks can use these for traffic engineering. Carrier-specific docs (Cogent, Lumen, etc.) list the communities they recognize.
  • DDoS amplification posture. An anycast pool is harder to overwhelm because traffic spreads naturally, but each PoP must still drop spoofed queries. Run ratelimit at the authoritative; consider DNS Response Rate Limiting (RRL).
  • DNSSEC implications. Every PoP serves the same RRSIGs, so signing is independent of anycast — sign at the primary, ship the signed zone to all PoPs. The only complication is clock sync: every PoP must agree on time for signature inception/expiration. Run chrony at every PoP.

In the engagements we run, building an anycast DNS pool from scratch is a major project — multi-month carrier setup, BGP negotiation, monitoring infrastructure. For most clients, the right answer is to buy authoritative DNS from a provider that already runs an anycast cloud, and use that as one leg of a multi-pool strategy where we run the other leg (potentially as a hidden primary plus a smaller unicast secondary cluster). See our multi-region environments for how this fits into the broader topology.