Skip to content
INTERNET INFRASTRUCTURE & NETWORKS

Cloudflare Expands Flamingo Testing Framework to Automate DNS Safety Checks and Prevent Edge Outages

Imagine this scenario: you have just pushed a routine software release. All the unit tests have passed successfully, and your system dashboards glow entirely green. You sit back at your desk to relax, only for your phone to suddenly start buzzing and blowing up with alerts. Production is broken.

This is a nightmare scenario that software engineering teams dread, and it is something the Cloudflare DNS team has experienced firsthand. During a previous rollout of the vital service responsible for publishing Domain Name System (DNS) records to the company’s global edge network, a subtle scheduling bug quietly let certain record changes sit unpublished for hours. The core service itself stayed up and remained entirely healthy on paper, but new hostnames suffered from sluggish resolution times, and essential security certificates could not be issued until the underlying bug was finally identified and squashed.

DNS failures are notoriously difficult to catch during standard testing cycles because they tend to manifest slowly, spread across a massive and complex network, and produce only partial impacts depending on the geographic region. Recognizing this blind spot, engineers realized they needed to figure out a reliable way to test DNS the exact way customers experience it: continuously, from every single data center around the globe, and directly against live production environments.

For Cloudflare, the definitive answer was to extend Flamingo, an advanced end-to-end testing framework the company was already utilizing to run hundreds of millions of automated tests every single day against its sprawling network edge. This expansion highlights how Flamingo’s modular architecture allows teams to easily incorporate new protocols like DNS, measure real-world propagation speeds with precision, and use those critical measurements to dynamically decide whether a software release should move forward or be automatically rolled back.

A Little Background on Infrastructure Safety

At Cloudflare, engineering teams are obsessed with continuously improving both performance and safety for their global customer base. It is crucial that code is tested constantly, operating at massive scale and running against the very same real-world edge infrastructure that end users rely on every day. That core requirement is precisely why the organization originally created Flamingo—to accurately measure the behavior of live production environments and verify that code deployed in lower-tier staging environments behaves exactly as expected before reaching the wider Internet.

The company has previously documented how this versatile tool has played a vital role in upgrades to its Content Delivery Network (CDN) stack. However, those CDN deployments represent only a fraction of how Flamingo is deployed internally. One of the standout architectural features of Flamingo is its modular design, which enables individual product teams to extend the core capabilities of the testing tool so that it can speak entirely different networking protocols. When the DNS team encountered their visibility gaps, they decided to leverage these modular capabilities to bring robust, automated DNS testing into the fold.

What is Flamingo?

Software testing is inherently difficult. Testing at a massive, global scale when dealing with a widely distributed systems architecture is exponentially harder. Requests take complex, winding pathways and must traverse multiple internal systems before ever making their way to an origin server. Traditional unit testing alone is simply not enough to guarantee stability in such environments. Organizations need to run constant, automated tests against real systems and closely measure the outcomes of those requests to make genuinely informed decisions regarding the operational health of a service.

Enter Flamingo. Originally built around complex, multi-step HTTP testing scenarios, its capabilities and overall scope have increased substantially over the years. Flamingo was built from the ground up with Cloudflare’s unique infrastructure in mind. Engineers developed a sophisticated control plane and scheduler that allow different teams to target specific environments, individual data centers, or precise percentages of bare-metal servers. Furthermore, the framework needed to integrate seamlessly with custom reporting, metrics, and analytics tooling while maintaining predictable performance and running efficiently on bare-metal servers located in resource-constrained environments.

When building critical internal tooling, engineering organizations strive to create a delightful developer experience. Internal tools must be as intuitive and easy to use as possible, yet powerful enough to handle the vast majority of complex use cases. For a new edge acceptance testing framework to succeed, it must enforce common guidelines and encourage teams to build reusable scripts within an environment that remains stable, scalable, and capable of managing immense technical complexity.

One thing that is universally frustrating for developers is debugging a broken test. If an engineer is allowed to write tests in a traditional, general-purpose programming language, a test failure often forces them into a frustrating double-debugging loop: they must troubleshoot both the upstream system being tested and the testing script itself. To avoid this pitfall, Flamingo was deliberately designed around a custom domain-specific language (DSL) built on a simple setup-request-response format.

For instance, consider a scenario where engineers want to ensure that all unencrypted HTTP traffic is automatically redirected to its encrypted HTTPS counterpart. Using Flamingo’s DSL, this verification can be expressed concisely in just a handful of lines of code. A script can be written to target a specific hostname, issue a request, and assert that the returned status code is a permanent redirect while verifying that the location header points to the secure URL.

This concise DSL format can run anywhere across Cloudflare’s global edge and effortlessly scale to thousands of requests per minute. The resulting data—generated from millions of individual data points—can then be aggregated into comprehensive graphs that define how a service is truly performing in the real world.

By taking this fundamental test format and modifying it slightly, developers can use Flamingo for far more than traditional HTTP testing. Instead of viewing the middle step strictly as an HTTP request, it can be generalized as a broader action. This transforms the system from something that exclusively makes HTTP requests into a flexible framework capable of performing any action for which the engineering team wishes to measure the outcome.

Probing DNS at Cloudflare

Within the Flamingo architecture, these capabilities are known as modules, and substantial effort has been dedicated to making them straightforward for any team to write. Flamingo is written in Rust, chosen specifically for its consistent performance characteristics and exceptionally strong type system. The type system heavily supports this modularity by allowing engineers to use strongly-typed enumerations for inputs and outputs within the core action runner.

This design successfully decouples the underlying logic required to perform a specific action—such as executing an HTTP request or a DNS query—into dynamically dispatched functions that can be called independently of other operations. Consequently, higher-level concerns like test scheduling and resource management are handled automatically, meaning module authors do not need to worry about infrastructure logistics and can focus entirely on the core business logic.

Using Flamingo to Probe DNS

An old industry adage states that whenever network issues arise, it is always DNS. Like many technical jokes, there is a core of truth behind the humor. The Domain Name System is an exceptionally important backbone of the Internet. Because it relies on a complex, hierarchical network of interconnected sources of truth, a single misstep can easily trigger a cascading storm of widespread failures.

DNS can be particularly finicky due to its hierarchical nature. When a DNS record is updated for a Cloudflare zone, that record must propagate reliably to authoritative nameservers so that the updated information becomes widely available. To reduce latency, records are also stored in physically localized caches closer to users. These records carry a Time to Live (TTL) value that instructs local DNS caches how long they can serve cached data before needing to refetch the fresh record from an authoritative server. Any unexpected delays in this propagation chain directly impact time-sensitive operations, such as automated TLS certificate issuance and rapid traffic failover during outages.

Because Flamingo was engineered for extensibility, one of the first and most impactful modules built by the team was designed specifically for this DNS use case. Engineers were able to extend the framework so that instead of dispatching HTTP requests, it could systematically send DNS queries. By integrating this into the existing platform, the DNS team received everything else for free; they did not have to worry about building and managing a brand-new probing service or figuring out how to integrate with reporting pipelines. It worked seamlessly out of the box.

To effectively probe DNS, the system measures how quickly customer record changes propagate to authoritative nameservers and public resolvers like 1.1.1.1. The automated test continuously updates a TXT record containing a dynamic timestamp, then queries three authoritative nameserver IP addresses and the public resolver from every single data center globally. It asserts that the record freshness falls well within strict thresholds—under 90 seconds for authoritative servers and under 600 seconds for public resolvers.

Catching Bugs Through SLOs and Steady Monitoring

To ensure that complex systems operate within acceptable parameters, engineering teams establish service-level objectives (SLOs) to observe metrics such as availability and latency. SLOs represent a target percentage for a given metric, and they are measured using service-level indicators (SLIs), which form the actual series of measurements capturing the end-to-end experience of a user interacting with the system.

By constantly feeding synthetic Flamingo traffic through production systems, Cloudflare builds an accurate picture of what actual end users experience, using that data directly to inform its SLOs. When synthetic traffic encounters anomalies or failures, engineers can be confident that real customers are experiencing similar issues, allowing them to triage and address the problem swiftly.

Once this observational data is collected, it enables teams to make informed, automated decisions when releasing new software versions. SLOs operate using error budgets and burn rates. An error budget defines the acceptable percentage of downtime or degradation a service can tolerate over a given period, while the burn rate measures how fast that budget is being consumed at any given moment. This framework allows automated systems to gauge the true severity of an issue in real time. For example, burning ten percent of an error budget over a three-day period might indicate a minor, long-running issue that needs attention without causing panic. However, burning that same ten percent of the error budget within a

single hour signals an active incident that requires immediate intervention to prevent substantial customer impact.

Armed with these metrics, release systems can continuously evaluate service health during a deployment. Depending on the incoming telemetry, automated release pipelines can be instructed to either safely promote a software change or immediately halt and roll back the deployment.

The Road Ahead

By migrating DNS monitoring workloads into the Flamingo framework, Cloudflare has established a proactive defense system capable of detecting DNS anomalies before they have any opportunity to spread across the wider edge network. If Flamingo detects an unexpected spike in propagation latency within a specific canary data center, the platform can automatically halt the rollout of a new software version before it impacts the rest of the Internet.

DNS is merely the starting point for extending Flamingo. The engineering organization currently maintains modules for testing TCP, UDP, WebSockets, and several other protocols. Having a unified, high-performance tool for rapidly testing and monitoring diverse services has empowered internal teams to deploy massive architectural changes safely, reducing the need for humans to constantly watch dashboards.