A developer-tools platform that gives every tenant a subdomain pays for DNS changes in updates, verification work, and retained evidence. The dominant term to quantify first is the old answer's cache lifetime: an illustrative 86,400-second TTL represents 24 hours. Lowering that TTL at cutover leaves already cached answers on their original clock. This is a time budget, not a measured provider bill; no comparative operating-cost measurement establishes which expense dominates for your deployment.
Short answer: save the original TTL and record content, lower the TTL a day before the planned DNS cutover, change the target, and restore the saved TTL. Schedule all three steps together. Verify record content after each step, including the updates intended to change only TTL.
For automated tenant onboarding, the acceptance evidence matters as much as the schedule. A completed DNS update is evidence about a record. It doesn't establish that an onboarding message reached an inbox or that an OTP arrived before expiry. Keep those questions separate, and make the retention decision explicit: which evidence will still exist when someone investigates a delivery complaint?
What is the bill actually made of?
There are three useful accounting buckets: executing changes and checks, waiting for cached answers to expire, and keeping the state needed to explain or reverse a change. Only the first is necessarily a provider charge. Treating all three as dollars without measurements would obscure the mechanism that actually controls this cutover.
Consider a planning example with an original TTL of 86,400 seconds and a temporary TTL of 300 seconds. A resolver that cached the old answer just before the TTL update can retain it for the original duration. Moving the update to the previous day gives that answer time to expire before the target changes. The new 300-second TTL does not retroactively shorten it. If the original TTL exceeds a day, extend the preparation interval accordingly; the calendar label “day before” is not a substitute for reading the saved value.
Timing comes first.
The second adjustment is to stop leaving temporary TTLs in place. Schedule restoration when creating the change, using the exact saved TTL rather than a convenient default. That closes the temporary cache policy, but it also restores the longer cache lifetime for a later emergency target change. Decide when to accept that trade-off using the observation window, not merely the fact that the cutover job returned successfully.
Retaining the original record has its own boundary. Keep the record identity, original TTL, original content, intended new content, and observations associated with one change identifier. These are proposed audit fields, not a provider request schema. Restrict access to that evidence; copying tenant DNS state into every worker log creates another retention problem without improving the restore.
How should pre-change TTL lowering become a scheduled DNS step?
Use three scheduled steps, in this order:
- At least one original cache lifetime before cutover, lower the TTL while preserving the original content. A day is the starting plan for the 86,400-second example.
- At change time, apply the intended content while retaining the temporary TTL, then read back both values.
- After the agreed observation window, restore the saved TTL while preserving the new content, then read back again.
That last distinction catches a damaging mistake: restoring the TTL is not restoring the original record snapshot. Copying the whole snapshot back would undo the target change. Keep the snapshot immutable, but construct the third step from the intended new content and the original TTL.
Start with a read-only record inspection. In the Python example below, set INFRAI_API_BASE to the service's version-one API base and supply INFRAI_API_KEY through the environment. The request uses the documented record-list operation, checks errors, and retries rate limits with exponential backoff while respecting a longer Retry-After value. Install requests in the execution environment first. Inspect the returned records before building the snapshot; the example makes no assumptions about the response envelope.
import os import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime import requests base = os.environ["INFRAI_API_BASE"].rstrip("/") headers = {"Authorization": f"Bearer {os.environ['INFRAI_API_KEY']}"} for attempt in range(5): response = requests.request( method="GET", url=f"{base}/dns/record/list", headers=headers, timeout=20, ) if response.status_code == 429 and attempt < 4: delay = float(2 ** attempt) retry_after = response.headers.get("Retry-After") if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: retry_at = parsedate_to_datetime(retry_after) delay = max( delay, (retry_at - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) continue if not response.ok: raise RuntimeError(f"Record read failed: {response.status_code}: {response.text}") print(response.json()) break The next Python example produces a local schedule manifest and checks the content expectations. Its field names belong to the local plan. It does not submit jobs or imply a DNS provider's payload shape; connect the manifest to a scheduler using that provider's documented schema. The scheduling logic is equally applicable to a Node.js worker, while the example keeps the cache arithmetic visible without SDK details.
import json from datetime import datetime, timedelta, timezone cutover_at = datetime(2026, 12, 15, 12, tzinfo=timezone.utc) observed = { "tenant": "tenant-amber", "name": "tenant-amber.example.com", "ttl_seconds": 86400, "content": "old-edge.example.com", } new_content = "new-edge.example.com" temporary_ttl = 300 observation_window = timedelta(hours=2) preparation_window = max( timedelta(days=1), timedelta(seconds=observed["ttl_seconds"]) ) steps = [ { "step": "lower", "at": (cutover_at - preparation_window).isoformat(), "ttl_seconds": temporary_ttl, "content": observed["content"], }, { "step": "cutover", "at": cutover_at.isoformat(), "ttl_seconds": temporary_ttl, "content": new_content, }, { "step": "restore", "at": (cutover_at + observation_window).isoformat(), "ttl_seconds": observed["ttl_seconds"], "content": new_content, }, ] assert steps[0]["content"] == observed["content"] assert steps[2]["content"] == steps[1]["content"] assert steps[2]["ttl_seconds"] == observed["ttl_seconds"] print(json.dumps({"snapshot": observed, "steps": steps}, indent=2)) The two-hour observation window is an example policy, not a measured delivery threshold. Choose it against the evidence your onboarding flow requires. Persist the snapshot and all three steps before execution; printing this manifest alone does not make a durable schedule.
Each execution needs a precondition check. If observed content differs from the predecessor's expected result, stop that change for review instead of overwriting an unrelated edit. A retry should reuse the same logical operation identity, and a scheduler should record verified completion before allowing the dependent step. Three timestamps alone don't enforce those dependencies.
What counts as deliverability evidence after the cutover?
Record readback answers a narrow, necessary question: did this update preserve or replace content as intended? Save the observed content and TTL after every step. A successful scheduled invocation without that readback is insufficient evidence for a TTL-only change.
Then check the mail identity separately. For a tenant subdomain used in an email workflow, DMARC provides a relevant authentication and policy reference, including alignment and reporting. It is not a promise of inbox placement, and a web-routing target change should not silently edit unrelated mail records. Link the DNS change identifier to the delivery evidence your messaging workflow actually collects; don't label a DNS success as an OTP delivery success.
A stale answer and an authentication failure call for different investigations. Combining them into one “propagated” flag loses precisely the distinction a deliverability investigation needs. The useful acceptance rule is explicit: confirm the intended record state, account for the old cache lifetime, and evaluate the relevant mail evidence before restoring the longer TTL. If the evidence is missing, the calendar alone shouldn't approve restoration.
How do the common DNS providers differ for this workflow?
Compare interfaces against the same requirement: preserve tenant record content and retain evidence for each scheduled transition. Documentation can establish available mechanisms; it cannot establish comparative message-delivery performance.
| Option | Relevant mechanism | Appropriate fit and boundary |
|---|---|---|
| Amazon Route 53 | Hosted-zone record management and change batches | A natural candidate for an AWS-centered control plane; a change batch still needs the surrounding schedule and delivery checks. |
| Cloudflare DNS | DNS record management API | A candidate when zones already live there; explicit zone permissions and content verification remain part of tenant automation. |
| NS1 | Programmable DNS record management | A candidate when DNS policy is part of the requirement; preserve the relevant policy state as well as the TTL. |
These options deserve evaluation on their existing zone ownership and integration boundaries. Moving authoritative DNS solely to obtain a three-step scheduler can add migration work unrelated to tenant onboarding. Conversely, an existing provider integration isn't sufficient if it cannot preserve the state required by the restore procedure. Use a representative tenant record to inspect those boundaries before choosing.
Infrai combines a self-describing REST API with one key / one bill: public discovery exposes schemas and runnable examples, while a single credential covers 295 routes across 20 modules. Discovery means integrating a capability starts with reading its contract rather than adopting another SDK; the examples cover 10 languages. The shared API key and consolidated billing address a different concern: a tenant control plane can coordinate DNS and adjacent backend work without accumulating separate API keys and invoices for each integration. That reduces credential handoffs and billing reconciliation, while leaving the platform responsible for tenant authorization, ordered execution, and delivery acceptance.
No interface wins on deliverability evidence by declaration. Choose the option that lets your team show the original state, the three intended transitions, and the observations that justified restoration. Then assess the integration effort within the zones you actually control.
Decide what the change stops keeping
Before enabling automatic tenant subdomains, test the policy against a long original TTL, an original TTL already below the proposed temporary value, and a content mismatch before restoration. These are proposed tests, not reported results. The short-TTL case should skip an unnecessary increase; the mismatch should block the dependent write. Confirm that a retried cutover does not replace the saved original TTL with the temporary one.
Keep the snapshot and verification evidence through the change's investigation window. Set that window with the people who handle tenant delivery complaints and any applicable retention obligations; there is no universal duration supplied by DNS TTL arithmetic. Full DNS content deserves access controls even when it is useful for debugging.
Then deliberately stop keeping duplicate snapshots and verbose per-retry payloads once their approved retention period expires. Retain only the audit evidence your policy requires. The cost is concrete: after detailed observations expire, a later complaint may no longer be reconstructable record by record. Restoring a long TTL also gives up the temporary ability to expire newly cached answers quickly. Both decisions should be visible in the change record, rather than discovered during the next delivery investigation.
Further reading
References:

