hn.today

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

s2.dev59 points45 comments
Screenshot of It's always DNS, so why are we running our own?

S2.dev wanted to remove its 100-basin-per-account limit. Because each basin gets its own subdomain and CNAME, unlimited basins meant supporting unlimited DNS records and making new records resolvable immediately. Route53 could hold the records, but its API rate limit - about five upserts per second at the time - made it a bottleneck. After an actor created tens of thousands of basins and left DNS updates backed up for hours, S2 enforced the limit. Batching would not guarantee immediate availability, and other managed providers had similar API constraints. S2 therefore built an authoritative DNS server that looks up basin mappings directly in its strongly consistent Cloud Spanner database.

The team implemented the server in Go using miekg/dns, supporting A, AAAA, NS, CNAME, and SOA queries, and tested it with unit tests, RFC compliance checks, and live smoke tests. Direct database lookups raised security concerns, especially the prospect that random queries for nonexistent names could trigger a flood of costly NXDOMAIN lookups. S2 put Cloudflare’s DNS Firewall in front of the server and restricted origin access to Cloudflare IPs; certificate challenges remain delegated to Route53. The service runs across two regional GKE clusters with multiple replicas and TCP and UDP load balancers, supported by monitoring and recovery runbooks. It is stable under live traffic, and customers can now create thousands of basins that are immediately usable, though DNS caching, DNSSEC, and failure handling remain areas for improvement.

Read on s2.dev45 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.