← Mon, Nov 16 digest

It's always DNS, so why are we running our own?

read article ↗ hn thread ↗

S2 replaced AWS Route53 with a custom Go-based authoritative DNS server backed by Google Cloud Spanner and Cloudflare DNS Firewall to support unlimited dynamic subdomains.

read it Offers a concrete look at bypassing managed DNS rate limits with a custom authoritative server, complete with architecture trade-offs.

summary

S2 needed to support unlimited dynamically created client subdomains with instant consistency, but AWS Route53's API rate limits choked during rapid bulk creation. To fix this, they built a custom authoritative DNS server in Go that performs live queries against Google Cloud Spanner. Because direct database queries expose the origin to costly NXDOMAIN attacks, they placed Cloudflare DNS Firewall in front of two GKE clusters running the DNS app. The resulting architecture handles massive dynamic scaling without API throttling bottlenecks.

key points

  1. AWS Route53 and other managed DNS providers limit API updates, failing under rapid bulk resource creation.
  2. The custom DNS server eliminates sync delays by querying Google Cloud Spanner live on every incoming request.
  3. Cloudflare DNS Firewall was added to protect the origin database from expensive DDoS and NXDOMAIN attacks.

who should read it

Backend and infrastructure engineers dealing with massive scale, dynamic subdomains, and DNS architectural limitations.

discussion mixed

consensus

Commenters largely agree that DNS is not inherently terrifying or overly complex to self-host, arguing that standard tools like PowerDNS or NSD could have solved this without custom code.

pushback

Several technical commenters questioned why S2 didn't just use wildcard subdomains pointing to regional cells instead of creating unique DNS records per basin and querying a database on every lookup.

best comment by reticulates ↗

I'm not familiar with your product, just the blog post + cell architecture documentation. Question: the documentation states that basins are assigned to a cell on creation and cannot move. Why choose to have explicit DNS records instead of wildcards with a subdomain per location? e.g: {basin}.us-east-1.s2.dev where *.us-east-1.s2.dev points to the cell? My best guess is that you prefer to have explicit architecture in case you need to move to a new cell for some reason, but maybe there was a different reason? The stuff around hitting the database on every query that necessitates a firewall …

It questions the core architectural choice, suggesting a wildcard CNAME approach would eliminate database overhead and security risks entirely.

Generated by an LLM from the article and thread. Check the sources before relying on it.