Cloudflare 的 DNS 探测实践
Cloudflare 扩展了其内部端到端测试框架 Flamingo,从每个数据中心持续对生产环境的 DNS 进行探测,并利用这些测量结果自动决定发布 DNS 记录到边缘的服务新版本是继续推进还是回滚。
促使这一做法的是一次过往事故:一个调度 bug 导致部分记录变更数小时未发布,而服务本身看起来完全健康,造成新域名解析缓慢、证书无法签发。由于 Flamingo 采用模块化设计,DNS 团队只需添加一个 DNS 查询模块,而无需构建新的探测服务,调度、报告和分析等能力都可以直接复用。该测试持续更新一条带时间戳的 TXT 记录,并从每个数据中心查询三个权威名称服务器 IP 以及 1.1.1.1 公共解析器,要求权威服务器在 90 秒内、解析器在 600 秒内反映最新值。
Flamingo 使用 Rust 编写,采用 setup-request-response 形式的 DSL;测试定义动作并分发给模块处理函数,因此模块作者只需实现动作本身的逻辑。探测结果用于服务等级目标(SLO)的错误预算和消耗速率计算,发布系统据此决定推进或回滚,例如在某个金丝雀数据中心出现传播延迟激增时自动停止新版本 rollout。
Flamingo 目前已有 TCP、UDP、WebSockets 等多个模块,文章指出这种方式让团队无需人工持续值守即可安全部署大规模变更。文末附有 Cloudflare 招聘页面的推广链接。
Probing DNS at Cloudflare
Cloudflare has extended Flamingo, its in-house end-to-end testing framework, to continuously probe DNS against production from every data center, and now uses the resulting measurements to automatically promote or roll back releases of the service that publishes DNS records to its edge.
The motivation was a past incident in which a scheduling bug left some record changes unpublished for hours while the service itself appeared healthy, delaying hostname resolution and certificate issuance. Because Flamingo is modular, the DNS team added a DNS query module rather than building a new probing service, inheriting scheduling, reporting, and analytics for free. The test continuously updates a timestamped TXT record and queries three authoritative nameserver IPs plus the 1.1.1.1 public resolver from every data center, asserting freshness within 90 seconds for authoritative servers and 600 seconds for the resolver.
Flamingo is written in Rust and uses a setup-request-response DSL; tests define actions that are dispatched to module handlers, so module authors only implement the action logic. The probe results feed service-level objectives (SLOs) with error budgets and burn rates, which let release systems decide whether to promote a change or roll it back, for example halting a rollout when propagation latency spikes in a canary data center.
Flamingo already has modules for TCP, UDP, WebSockets, and more, and the post notes the approach lets teams deploy large changes safely without constant human monitoring. The post ends with a plug for Cloudflare's careers page.
猎鹰不保存原文正文。标题与摘要用于快速发现信息,事实细节请以来源原文为准。