DNS failures tend to be slow, geographically uneven, and partial in impact, which makes them easy to miss with conventional testing. The Cloudflare DNS team ran into exactly this: a scheduling bug in the service that publishes records to the edge left some record changes unpublished for hours. The service itself stayed up and appeared healthy, but new hostnames resolved slowly and certificates could not be issued until the bug was fixed. The team's conclusion was that DNS has to be tested the way customers experience it — continuously, from every data center, against production.

The vehicle for that is Flamingo, Cloudflare's end-to-end testing framework, which already runs hundreds of millions of tests a day against the edge for HTTP. Extending it to DNS required a module rather than a new probing service.

Why Flamingo exists

Unit tests cannot cover a widely distributed system in which requests traverse many complex pathways and multiple systems before reaching an origin. What is needed is constant automated testing against real systems whose outcomes feed decisions about service health. Flamingo was originally built around multi-step HTTP tests, and its scope has grown since. It ships with a control plane and scheduler so teams can target specific environments, data centers, or percentages of metals, and it integrates with Cloudflare's reporting, metrics, and analytics tooling. It is also designed for predictable performance on bare-metal servers in resource-constrained environments.

A design goal for internal tooling of this kind is ease of use while still covering more than 80% of use cases, in a setup that pushes teams toward common guidelines and reusable scripts. A key decision was the language tests are written in. In a general-purpose language, a failing test forces the author to debug both the system under test and the test. Flamingo avoids that with a domain-specific language built on a simple setup-request-response format. A script checking that unencrypted traffic redirects to its encrypted counterpart looks like this:

TEST test-redirect
SET $hostname www.cloudflare.com

GET "http://$(hostname)/"

ASSERT STATUS IS 301
ASSERT HEADER Location IS "https://$(hostname)/"

Five lines yield a script that runs anywhere on the edge and scales to thousands of requests per minute; the resulting data points can be turned into a graph of real-world service performance.

From requests to actions, and actions to DNS

The modular step was to reinterpret the middle element of that format as an action instead of an HTTP request, turning Flamingo from an HTTP client into a system that performs arbitrary actions whose outcomes are measured. These are called modules, and Flamingo is written in Rust — chosen for consistent performance and a strong type system. Strongly typed enumerations for module input and output make the action runner generic:

pub enum Action {
  Query {
    method: String,
    url: Expression,
    parameters: Vec<http::QueryParameters>,
  },
  DnsQuery {
    query_name: Expression,
    query_type: Expression,
    parameters: Vec<dns::DnsQueryParameters>,
  },
}

pub enum ActionOutput {
  Http(http::FetchResponse),
  Dns(dns::QueryResponse),
}

pub type ActionHandlerFunction = Arc<
  dyn Fn(
      Action,
      Arc<Ctx>,
      InterpreterConfig,
    )
      -> BoxFuture<'static, Result<ActionOutput>>
    + Send
    + Sync
    + 'static,
>;

pub type ActionHandlerLUT = Arc<
  dyn Fn(&Action) -> ActionHandlerFunction
    + Send
    + Sync
    + 'static,
>;
Module logic for performing an action is decoupled into a dynamically dispatched function that can be called independently of other actions. Scheduling and resource management remain higher-level concerns that a module author does not need to handle.

DNS as a module

DNS is hierarchical and depends on a web of interconnected sources of truth, so a single misstep can cause widespread failures. A changed record must propagate to authoritative servers to become widely available, and to limit latency records sit in physically closer caches with a TTL that governs when they are refetched from the authoritative server. Delays hurt time-sensitive operations such as certificate issuance and traffic failover.

The DNS probe was among the first and most impactful modules. Adding code that sends DNS queries instead of HTTP requests gave the team reporting, scheduling, and everything else in Flamingo for free, with no separate probing service to operate. The probe measures how quickly customer record changes propagate by continuously writing a timestamp into a TXT record, then querying three authoritative nameserver IPs and the public resolver at 1.1.1.1 from every data center. Freshness must fall within 90s for authoritative servers and 600s for the resolver.

TEST test-propagation-delay-direct-108-162-193-62
MOD dns

SET $hostname "some.probe.domain"
SET $authNs 108.162.193.62:53 # amir.ns.cloudflare.com

QUERY $hostname TXT
TARGET $authNs

ASSERT DNS.RCODE IS NOERROR
ASSERT DNS.FLAGS CONTAINS AA
ASSERT DNS.ANSWERS[0] GT SUBTRACT(TIMESTAMP(), "90")

SLOs, error budgets, and release decisions

Flamingo's synthetic production traffic is used to approximate what real users experience, feeding the service-level indicators (SLIs) behind service-level objectives (SLOs) — percentage targets for metrics such as availability and latency. When the synthetic traffic hits a problem, the team can assume customers are hitting it too and triage accordingly.

SLI showing DNS probes that successfully completed below the required threshold as a function of time.

Those SLOs inform releases. SLOs work through error budgets and burn rates: the budget is the downtime a service tolerates, and the burn rate is the rate of change in that budget. The two combined let automation judge severity. Consuming 10% of an error budget over three days is a long-running problem that is not urgent but affects customers; consuming the same 10% within an hour means an incident with substantial impact unless it is fixed immediately. Deploying while watching these numbers, releasing systems can promote a change or roll it back.

img2

What the shift enables

Moving DNS monitoring into Flamingo keeps DNS issues from spreading further into the edge. If propagation latency spikes in a canary data center, the rollout of a new software version can be halted automatically before the wider Internet is affected.

DNS is only the first of these extensions. Modules now exist for TCP, UDP, WebSockets, and several more. A single tool for testing and monitoring services has let teams ship large changes safely without a human watching continuously.