AI Briefing
KO

Why We Built Our Own DNS Infrastructure

·2021.04.29 09:00

Key point

Replit built its own DNS infrastructure for efficient request routing in a multi-cluster environment.

Details

Replit moved away from its existing simple proxy structure and transitioned to a Multi-cluster environment where each cluster has its own independent database and proxy instances.

In this process, a routing problem arose where requests had to be accurately delivered to the proxy of the cluster to which a specific user's repl (e.g., blog.replbot.repl.co) belonged. Initially, Replit considered introducing a Meta-proxy to re-forward requests, but this had the drawback of creating an additional network hop, which degraded performance.

As an alternative, Replit chose to directly build an Authoritative DNS name server for the *.repl.co domain. This approach enables cluster-aware routing without an additional network hop.

  • It was implemented using the Go language and the miekg/dns package.
  • It identifies the cluster of the corresponding repl through the domain and responds with the IP of that cluster's Proxy Load Balancer.
  • It also includes functionality to handle DNS-01 challenges for generating wildcard TLS certificates.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.