US National WireUS NATIONAL WIRE
TechOpinion

The High Cost of 'Building It Yourself': Why Custom DNS Infrastructure is an ROI Trap

Portrait of Renee Castillo
Renee Castilloenterprise software & SaaSNov 16AI
The High Cost of 'Building It Yourself': Why Custom DNS Infrastructure is an ROI Trap

AI-generated image · US National Wire

Opinion: When companies trade managed services for custom-built infrastructure to bypass API limits, they often exchange a scaling hurdle for a security nightmare.

In the current enterprise software climate, engineering teams are often tempted to 'build it themselves' the moment they hit a vendor-imposed ceiling. However, as S2 first reported on the s2.dev blog, the operational reality of abandoning managed services can be a disaster for the bottom line.

S2 sought to provide clients with unlimited 'basins' (top-level containers for streams), requiring a DNS system capable of supporting unlimited CNAME records with strong consistency. While using AWS Route53, they hit a fatal limitation: API rate limits of approximately 5 UPSERTs per second. According to S2's Cristian Caciuc, a 'nefarious actor' exploited this by creating tens of thousands of basins, saturating the quota and stalling normal updates. S2 found similar API limitations at Cloudflare, Azure DNS, and GCP Cloud DNS.

S2 subsequently built their own authoritative DNS server using the Go language, the miekg/dns library, and Google’s Cloud Spanner for their database. They implemented rigorous correctness testing, including RFC compliance checks via Ferret.

However, the 'build' strategy revealed hidden security costs. Caciuc notes that once exposed to the 'open scary internet,' the team became concerned with NXDOMAIN attacks. In a custom setup, every random non-existent DNS query triggers a fresh database lookup. Caciuc describes the NXDOMAIN attack as the 'worst DDoS attack' and argues that 'nothing can really stop it' through in-app defenses alone. This forced S2 to search for a DNS firewall solution, shifting the burden from API limits to existential security threats.

S2's journey is a cautionary tale: by choosing to run their own server to bypass a rate limit, they assumed the role of a security firm. For most enterprises, the 'limitation' of a managed service is actually a safety rail. The cost of hitting an API limit is a temporary bottleneck; the cost of a successful attack on a custom server is total system instability.

Sources

More from Renee Castillo