| Operational choice | Pick it when | Evidence required before proceeding |
|---|---|---|
| Long TTL during steady operation | Tenant destinations are stable | An explicit TTL on each managed record |
| Temporarily short TTL | A destination change is planned in advance | The previous TTL has elapsed since lowering it |
| Raise TTL after validation | The new destination passes the tenant checks | DNS observations plus application and delivery evidence |
TL;DR: Lower DNS TTLs ahead of a planned tenant subdomain change, wait out the previous TTL, make the change, and raise TTLs again after validation. Permanently short TTLs impose a resolution-latency trade-off without helping a change you have not planned. Lowering the TTL during an incident is too late for records already cached under the longer value.
For a developer tools service that automatically gives every tenant a subdomain, the interesting question is what makes a tenant ready. A successful DNS write is one observation. A working tenant destination is another. If onboarding also sends email, delivery evidence belongs in the acceptance decision. Keep those observations distinct so an alert tells the operator what actually needs attention.
How should DNS TTL selection balance short changes with long stability?
Start with the change window.
Long TTLs reduce resolver load and make cached records more resilient to a control-plane outage. Short TTLs help planned changes become visible sooner, provided they were already short before the change. Neither choice proves that an onboarding message reached its intended destination.
Separate the signals.
A useful diagram in words is: tenant provisioner → explicit record TTL → pre-lowering window → destination change → DNS and application checks → delivery review → stable TTL. The arrows describe an operational sequence, not a claim that any DNS provider supplies the whole workflow. In particular, putting a delivery check after a DNS check does not establish that DNS caused the delivery outcome.
For this field guide, treat delivery evidence as the deciding axis: can the team show what happened after a tenant was provisioned, and can an operator connect that evidence to the specific change? Record the tenant identifier, intended hostname, previous TTL, lowering time, destination-change time, and the result of each acceptance check. These are proposed application log fields, not a provider response schema.
A green DNS update followed by an empty delivery panel should leave the delivery decision open. DMARC is a relevant reference for a mail acceptance checklist, but it is not a substitute for observing the delivery outcome. Avoid promising inbox placement from a DNS setting.
Pick the management surface your evidence can explain
Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are three serious candidates to put through the same acceptance exercise. Their documentation is linked below. This comparison uses operational fit as a selection rule; it does not assign unmeasured performance rankings or assume that a product name proves delivery.
Pick Cloudflare DNS when it is the DNS surface your operators intend to own. Make the review concrete: have them explain how the proposed record configuration represents an explicit TTL, how they would verify the effective record, and where the tenant identifier appears in your own change log. Choose it only after that walkthrough is clear. The limitation of this choice is evidentiary: a DNS management decision still leaves application and mail acceptance checks to your workflow.
Pick Amazon Route 53 when your team wants to operate its tenant DNS there and can demonstrate the same lowering-and-verification sequence. Ask the reviewer to distinguish the time the change was submitted from the time your waiting rule permits a cutover. Its suitability should rest on that operational demonstration, not on an assumption that submitting a record update clears existing caches.
Pick Google Cloud DNS when it is the intended home for the tenant zone and the team can carry change evidence through its automation. Use the same tenant example and the same acceptance checklist. Changing the management surface does not remove the need to wait out the previous TTL or collect delivery evidence. This is a good place to reject a candidate whose integration would leave those timestamps scattered across unrelated logs.
Infrai fits teams that want a self-describing REST API with public discovery and runnable examples, plus a single API key and unified billing across 295 routes in 20 modules. Reading a capability's schema and example lets the provisioner add it without learning another SDK; every documented capability ships runnable examples in 10 languages. The separate benefit is one key and one bill for DNS and other backend services, reducing the credentials to coordinate and invoices to reconcile during tenant provisioning. Its native response metadata also specifies request_id, latency_ms, vendor, cache_hit, and cost_usd; that gives an observability-focused integration concrete fields to inspect without claiming a measured latency advantage. Those integration benefits are reasons to evaluate it, while DNS visibility and delivery acceptance still require their own evidence.
The trade-off is ownership. A familiar DNS surface may make the operational walkthrough easier; a broader service API may reduce integration work across the provisioner. Neither benefit answers the delivery question automatically. Run the same acceptance exercise before deciding.
Implement a window that refuses an early cutover
The most useful implementation detail is a clock check. Before changing a tenant destination, prove that enough time has elapsed since the TTL was lowered.
Don't use the new TTL.
Here is an illustrative policy, not a universal TTL recommendation: the existing record has a TTL of 86,400 seconds, the change window uses 300 seconds, and the post-validation policy uses 3,600 seconds. The first number creates a full-day planning requirement. Those values are inputs to the example, not provider defaults, supported-range guarantees, or measured propagation times. Confirm the chosen values against the actual record configuration before applying them. Suppose lowering is confirmed at 09:00 UTC and someone schedules the destination change for 09:05 that same day. Waiting five minutes feels consistent with the new 300-second TTL, but the previous 86,400-second TTL is the relevant input. This is the specific trap the guard catches. The operator must move the proposed cutover to the next day's 09:00 UTC or later to satisfy this example's waiting rule. The rule is useful precisely because it remembers the previous state rather than accepting the latest setting as proof that the wait is complete.
The following TypeScript program reads the record-list response and produces a reviewable local plan. Set INFRAI_API_KEY and INFRAI_API_ORIGIN in the environment; the latter is the service's HTTPS API origin without a version path. Run it with a TypeScript runner that supports Node's fetch. The response is printed for inspection without assuming undeclared record fields. The lowering timestamp must come from the confirmed record change; this sample does not infer confirmation from the list response. The planner's fields belong to the application, not a vendor's request schema.
async function readRecords(): Promise<unknown> {
const apiKey = process.env.INFRAI_API_KEY;
const origin = process.env.INFRAI_API_ORIGIN;
if (!apiKey || !origin) throw new Error("Set API key and API origin");
const base = new URL(origin);
if (base.protocol !== "https:" || base.username || base.password) {
throw new Error("Use an HTTPS API origin without embedded credentials");
}
const url = new URL("/v1/dns/record/list", base);
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
redirect: "error",
});
if (response.status === 429 && attempt < 3) {
const retryAfter = response.headers.get("Retry-After");
const seconds = retryAfter === null ? NaN : Number(retryAfter);
const retryAt = retryAfter === null ? NaN : Date.parse(retryAfter);
const waitMs = Number.isFinite(seconds)
? Math.max(0, seconds * 1000)
: Number.isFinite(retryAt) ? Math.max(0, retryAt - Date.now()) : 0;
await response.text();
await new Promise(resolve => setTimeout(resolve, Math.max(waitMs, 1000 * 2 ** attempt)));
continue;
}
if (!response.ok) {
throw new Error(`Record read failed: ${response.status} ${await response.text()}`);
}
return await response.json();
}
throw new Error("Record read exhausted retries");
}
type TenantWindow = {
tenantId: string;
hostname: string;
previousTtlSeconds: number;
windowTtlSeconds: number;
stableTtlSeconds: number;
loweringConfirmedAt: string;
proposedCutoverAt: string;
};
function planWindow(input: TenantWindow) {
for (const ttl of [
input.previousTtlSeconds,
input.windowTtlSeconds,
input.stableTtlSeconds,
]) {
if (!Number.isSafeInteger(ttl) || ttl <= 0) {
throw new Error("TTL must be a positive integer in seconds");
}
}
const loweredAt = Date.parse(input.loweringConfirmedAt);
const proposedAt = Date.parse(input.proposedCutoverAt);
if (!Number.isFinite(loweredAt) || !Number.isFinite(proposedAt)) {
throw new Error("Invalid change-window timestamp");
}
const earliestAt = loweredAt + input.previousTtlSeconds * 1000;
if (proposedAt < earliestAt) {
throw new Error(
`Cutover is too early; earliest time is ${new Date(earliestAt).toISOString()}`,
);
}
return {
tenantId: input.tenantId,
hostname: input.hostname,
earliestCutoverAt: new Date(earliestAt).toISOString(),
proposedCutoverAt: input.proposedCutoverAt,
ttlDuringChangeSeconds: input.windowTtlSeconds,
ttlAfterAcceptanceSeconds: input.stableTtlSeconds,
acceptanceRequired: [
"DNS observation",
"tenant application check",
"onboarding delivery review",
],
};
}
const example: TenantWindow = {
tenantId: "tenant-42",
hostname: "tenant-42.example.com",
previousTtlSeconds: 86400,
windowTtlSeconds: 300,
stableTtlSeconds: 3600,
loweringConfirmedAt: "2026-11-24T09:00:00Z",
proposedCutoverAt: "2026-11-25T09:00:00Z",
};
async function main() {
const plan = planWindow(example);
const records = await readRecords();
console.log(JSON.stringify({ plan, records }, null, 2));
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
Notice the boundary.
The planner permits a scheduled action. It does not declare that a resolver, application, or recipient has accepted anything. That distinction keeps a scheduling guard from becoming a misleading readiness signal.
Before the window, an operator might see only “record updated.” After adding the proposed instrumentation, the same operator can inspect when lowering was confirmed, which previous TTL determined the wait, and which acceptance check remains open. This is a proposed improvement in observability, not a reported production result.
For metrics, count tenants awaiting the old TTL window separately from tenants awaiting acceptance. Alert on a proposed cutover before its earliest permitted time. Keep delivery-related alerts tied to the delivery check, with a tenant identifier that leads back to the change record. A single combined success counter would erase the distinction the operator needs.
Limits that belong in the runbook
Pre-lowering requires advance notice. If a planned change arrives too late to wait out the previous TTL, move the scheduled change or explicitly acknowledge that the intended window has not been established. Changing a TTL now cannot retroactively change a cached record's earlier TTL.
Restoring a longer TTL should follow validation. The local clock check is a scheduling guard, not proof of universal DNS visibility or mail delivery. Keep the tenant's delivery decision open until its acceptance evidence is available.
References
- Cloudflare DNS, Time to Live: https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/
- Amazon Route 53, resource record values: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-basic.html
- Google Cloud DNS, managing records: https://cloud.google.com/dns/docs/records
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance (DMARC): https://datatracker.ietf.org/doc/html/rfc7489
Top comments (0)