---
title: "Why We Built Our Own DNS Infrastructure"
description: "Replit made its repl hosting cluster-aware by running its own authoritative DNS server for *.repl.co, which resolves each repl's domain to the proxy load balancer in the cluster hosting that repl."
url: "https://swe.quest/articles/why-we-built-our-own-dns-infrastructure-b1c8975cd0ea6aa3"
canonical: "https://replit.com/blog/dns"
source: "Replit"
published: "2021-04-29"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["dns","load-balancing","distributed-systems","go"]
---

# Why We Built Our Own DNS Infrastructure

A post on [Replit](https://swe.quest/sources/replit.md), published 2021-04-29, 4 min read, Case study. Original: [https://replit.com/blog/dns](https://replit.com/blog/dns)

## Summary

Replit made its repl hosting cluster-aware by running its own authoritative DNS server for \*.repl.co, which resolves each repl's domain to the proxy load balancer in the cluster hosting that repl. This avoided a "meta-proxy" layer that would have added two extra hops per request. The Go server, built on miekg/dns, CNAMEs ACME DNS-01 challenges to a GCP-managed validation zone. Because DNS caching can outlive the 60s TTL, proxies in the old cluster use tombstones to transparently forward requests for repls that have moved. Custom domains work unchanged because they already CNAME to \<repl id\>.repl.co.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [DNS](https://swe.quest/tags/dns.md) (Infrastructure)
- [Load balancing](https://swe.quest/tags/load-balancing.md) (Infrastructure)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Go](https://swe.quest/tags/go.md) (Languages)

## Prerequisites

- DNS record types and TTLs ([easy posts on DNS](https://swe.quest/tags/dns.md?difficulty=easy))
- reverse proxies and load balancers ([easy posts on Load balancing](https://swe.quest/tags/load-balancing.md?difficulty=easy))

## Keywords

Replit, miekg/dns, DNS-01, ACME, GCP, repl.co

## Related posts

- [Welcome to the Wonderful World of Clusters](https://swe.quest/articles/welcome-to-the-wonderful-world-of-clusters-52a29e1c3fc463f3.md): Replit · 2021-03-26 · Medium · 5 min read · System design, DNS, Resilience, Distributed systems, Cloud platforms
  Replit split its infrastructure into multiple independent clusters (failure domains) after two load-related site-wide outages, moving paid Hacker users into their own cluster so future incidents affect only a subset of users.
- [HTTPS by default](https://swe.quest/articles/https-by-default-5a72c4dccd95a788.md): Replit · 2021-02-26 · Medium · 4 min read · Cryptography, Networking, DNS, Load balancing
  Replit's proxy now redirects all HTTP requests to server repls to HTTPS and serves HSTS headers, so every hosted server is HTTPS by default.
- [Sharding Infrastructure: The Regional Goval Project](https://swe.quest/articles/sharding-infrastructure-the-regional-goval-project-86db1e97083bbccb.md): Replit · 2024-02-14 · Medium · 7 min read · Infrastructure as code, Distributed systems, Cloud platforms, Resilience, Deployment
  Replit re-sharded the infrastructure that runs Repls (Goval) from a few unbalanced, multi-region clusters partitioned by user membership into uniformly sized, single-region clusters with Repls distributed by consistent hashing, shrinking failure domains and removing cross-region traffic.
- [Probing DNS at Cloudflare](https://swe.quest/articles/probing-dns-at-cloudflare-ecbd543e122dda77.md): Cloudflare · 2026-11-23 · Medium · 8 min read · DNS, Testing, SRE, Deployment, Rust
  Cloudflare extended Flamingo, its Rust-based end-to-end testing framework that runs hundreds of millions of tests a day against the production edge, with a DNS module to catch slow, partial DNS failures that unit tests and health checks miss.
- [Replit²](https://swe.quest/articles/replit2-f7f8a0a22edfb202.md): Replit · 2021-08-06 · Medium · 15 min read · JavaScript, Sandboxing & isolation, Load balancing, Python
  A Replit Nix repl can act as a code-execution backend: a Koa.js server spawns a Python child process and feeds user code through stdin, using code.InteractiveInterpreter, which avoids shell injection and keeps crashes from taking down the server.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
