Targeted Rebuilds: Cutting DNS Build Delay Safely
Rebuild only what a config change can affect — and prove it before you skip the rest.
Reviewed by Abhijith N M · 24 October 2026 · Editorial standards
A DNS zone is a database of records: names mapped to addresses, mail servers, verification strings. Cloudflare says that when someone changed a zone setting, its system rebuilt the whole zone — even zones holding tens of millions of records. Most of those records had nothing to do with the setting that changed. So Cloudflare built a planner. Before building, it works out the smallest set of records a given change could affect, builds that set, and skips the rest. It reports that this cut full builds by 40%, peak memory by 85%, and halved build delay. The evidence gives outcomes, not the planner's internals, so the mechanism below is the general principle, not a description of their code. The principle: a change has a dependency footprint. If you flip a setting that only affects how records are served at the edge, records that don't reference that setting can't change. Compute the footprint, rebuild inside it, keep everything outside it as-is. The hard part is proving the footprint is complete — miss one dependent record and you serve stale data. That is why the fallback matters. When the planner can't prove a change is contained — an unknown setting, a dependency it can't trace — it does the full build. Correctness first, speed second. This is analysis, not a claim about Cloudflare's design. The pattern generalizes: any system that recomputes everything on every config change (search indexes, cache manifests, compiled configs) can ask the same question. What is the smallest set I can safely rebuild, and can I prove it?
Targeted Rebuilds: Cutting DNS Build Delay Safely — Visual Breakdown
# Analysis: the general shape of a dependency-aware rebuild.
# Not Cloudflare's implementation.
def rebuild(changed_setting, zone, planner):
affected = planner.affected_records(changed_setting, zone)
if affected is None: # planner could not prove containment
return full_build(zone) # correctness first
for record in affected:
zone[record] = build_record(record, zone.settings)
return zone # untouched records stay as-is
# The planner's job is the hard part: return None whenever it
# cannot trace every dependency of the changed setting.
Quick Concept Check
Test your understanding in 15 seconds
Why does the planner fall back to a full build instead of always doing a targeted one?
Related Concepts
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.