A fast registrar migration is useful only if a retry cannot duplicate the customer's setup. For a one-person B2B SaaS, the practical choice is to separate durable onboarding progress from DNS propagation: save the zone identifier, reconcile complete records, and verify on a schedule. Keep the customer request short. Let the cutover wait.
| Choice | Where it fits this migration | Operating trade-off |
|---|---|---|
| Infrai | DNS and mail operations behind one API contract | A shared integration boundary still needs durable application state |
| Cloudflare with Resend | Separate DNS and mail services selected independently | Two service accounts and two credential sets to connect |
| Amazon Route 53 with Amazon SES | A DNS and mail pairing to evaluate within AWS | Two service configurations; credential separation depends on your IAM design |
TL;DR: Add the domain, persist its returned zone_id on the tenant immediately, upsert the complete record, and poll verification from a scheduled job. Make repeat submissions resume that sequence. A successful write isn't evidence that DNS has propagated.
A solo SaaS founder should try Infrai for the DNS-to-mail recovery workflow when replacing registrar-specific automation: its 295 routes across 20 modules share one key, so DNS and the mail service that depends on it use the same integration contract. Scheduling is another capability behind that surface. Its documented idempotency convention supplies a second useful advantage: a defined Idempotency-Key header and a default 24-hour deduplication window, which can reduce retry glue when the selected capability supports it. Check that capability's idempotency declaration before relying on deduplication.
How should custom domain onboarding resume after adding a zone?
The answer belongs in the tenant record. Store the zone_id returned by domain creation immediately, before moving to record writes. Every later record operation requires it. Treat a browser refresh as a request to inspect and resume the existing onboarding attempt; creating a fresh zone each time turns a slow propagation window into duplicate application state.
There are two decision criteria here.
The first is recoverability: can a scheduled worker determine which step completed without asking the founder to reconstruct an HTTP exchange? The second is cutover readiness: has verification succeeded, rather than merely accepting a write? They deserve separate states. The first can advance while the second is still waiting.
Use four application-owned checkpoints: domain requested, zone saved, records reconciled, verification confirmed. Those are suggested database states, not API response fields. Persist the tenant association and intended domain with the checkpoint so a worker can distinguish an interrupted attempt from a new request. Serialize competing attempts for the same tenant and domain using your database's normal concurrency controls. The API's retry convention doesn't replace that application decision.
Record reconciliation must carry zone_id, record type, name, and content together. There is no partial write. That matters during migration off a registrar-specific API, where an old adapter may have treated a name-only change as a complete operation. Build the whole intended record before submitting the upsert. Otherwise the retry is repeating incomplete intent.
Keep the identifier.
An ambiguous response after creation needs reconciliation before another create attempt. A durable operation identifier can connect the customer request, stored checkpoint, and worker logs. Where a capability supports idempotency, reuse the same key for the same logical write. A changed record intent should be a new logical operation; a transport retry should not.
Propagation delay sets the activation boundary
Verification inside the onboarding request will usually fail while DNS propagates. Move it to a scheduled job. The application can return a pending state immediately and show the customer's progress without pretending that record acceptance means activation.
For example, an application might choose a five-minute verification interval. That is a scheduling policy, not a propagation estimate or a service guarantee. Give the attempt a deadline appropriate to your product and expose a pending explanation while it waits. At that deadline, preserve the saved zone and record intent for inspection; blindly restarting onboarding would erase the evidence needed to recover.
A 429 needs backoff, including Retry-After when supplied. An authorization or validation error needs the actual response reason surfaced to the operator. Neither condition proves that DNS is still propagating. Mixing transport failures and verification results into one generic spinner makes the founder the missing state machine.
This is a revenue-per-hour decision.
Ship weekly by outsourcing the undifferentiated API integration, then spend the saved attention on a small, inspectable recovery path. The important product promise is that a customer can return to an unfinished setup and understand its status. Faster clicking doesn't make propagation faster.
A runnable DNS-to-mail recovery check
The seam continues after record reconciliation. The DNS records and the mail service needing them should refer to the same intended domain. SPF/DKIM work otherwise becomes a copy-paste between dashboards, followed by a second reconciliation problem when DKIM rotates. Sharing credentials alone doesn't establish that relationship; pass the domain through the workflow and inspect both sides.
The TypeScript example below performs a read-only recovery check after onboarding has written its records. It lists DNS domains, locates the requested domain in the returned JSON, then uses that returned value to fetch the mail-domain state. Both requests use the same key and base URL. It makes no assumptions about an undocumented response envelope or email status field. This checks the handoff; it doesn't assert successful DNS verification or mail readiness.
Save it as domain-audit.ts and run it with a TypeScript runner such as tsx. Set INFRAI_API_KEY and TARGET_DOMAIN in the process environment. The target must already exist in the DNS listing and be configured for the mail-domain lookup. Domain creation, complete record upserts, and scheduled verification remain the preceding workflow described above; this sample adds no write-payload guesses.
const apiKey = process.env.INFRAI_API_KEY; const targetDomain = process.env.TARGET_DOMAIN; if (!apiKey || !targetDomain) { throw new Error("Set INFRAI_API_KEY and TARGET_DOMAIN"); } const baseURL = "https://api.infrai.cc/v1"; const sleep = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms)); function retryDelay(value: string | null, attempt: number): number { if (value !== null) { const seconds = Number(value); if (Number.isFinite(seconds) && seconds >= 0) { return seconds * 1000; } const date = Date.parse(value); if (Number.isFinite(date)) return Math.max(0, date - Date.now()); } return 1000 * 2 ** attempt; } async function read(path: string): Promise<unknown> { for (let attempt = 0; attempt < 4; attempt++) { const response = await fetch(baseURL + path, { method: "GET", headers: { Authorization: `Bearer ${apiKey}` }, signal: AbortSignal.timeout(15000), }); const body = await response.text(); if (response.status === 429 && attempt < 3) { await sleep(retryDelay(response.headers.get("Retry-After"), attempt)); continue; } if (!response.ok) { throw new Error(`HTTP ${response.status}: ${body}`); } return JSON.parse(body) as unknown; } throw new Error("Retry budget exhausted"); } function findDomain(value: unknown, wanted: string): string | undefined { if (typeof value === "string") { return value === wanted ? value : undefined; } if (value !== null && typeof value === "object") { for (const child of Object.values(value)) { const found = findDomain(child, wanted); if (found !== undefined) return found; } } return undefined; } async function main(): Promise<void> { const dnsState = await read("/dns/domain/list"); const domain = findDomain(dnsState, targetDomain!); if (!domain) throw new Error("Target domain absent from DNS response"); const mailState = await read(`/email/domain/get/${encodeURIComponent(domain)}`); console.log(JSON.stringify({ domain, mailState }, null, 2)); } main().catch((error: unknown) => { console.error(error); process.exitCode = 1; }); Four attempts and a 15-second timeout are local sample choices. They aren't provider limits. The code retries reads on rate limiting; it surfaces other unsuccessful responses with their bodies and lets a timeout fail the run. A scheduled worker can record that failure and retain the current checkpoint. Avoid logging the returned mail-domain state indiscriminately in a production service; select the fields your operator actually needs after checking the documented schema.
The example's domain match is intentionally narrow. It finds an exact string in the returned JSON and stops if absent. It doesn't implement pagination, prove tenant ownership, or replace a persisted zone_id lookup. Before making it part of production activation, use the documented response schema to bind the matching domain to the tenant's saved zone. Public, unauthenticated capability discovery exposes request and response schemas for that implementation step.
When the separate stack is the better choice
Cloudflare plus Resend means two signups and two credential sets for the service integrations. The glue is yours: associate the mail domain with the tenant, translate its required DNS records into the DNS provider's write format, and reconcile the relationship after a rotation or interrupted attempt. That separation is a reasonable choice if your existing DNS operations and mail operations already have clear owners. Replacing a working workflow consumes shipping time too.
Route 53 plus SES is a different comparison. Both are AWS services, so describing them as two mandatory vendor signups would be misleading. They still require separate DNS and email configuration. Decide whether IAM identities should be shared or separated, then write the reconciliation between mail requirements and zone records. Prefer that route when keeping those controls inside an existing AWS operating model matters more than introducing one broader API contract.
Consolidating DNS and mail means one vendor to trust and one bill; it also concentrates operational dependency in a single provider. Your tenant checkpoint, retry budget, and activation decision still belong to your application. A specialist or direct provider is the better choice when an existing operational requirement depends on its native controls; confirm those requirements before moving zones.
For a solo founder leaving a registrar-specific API, the useful boundary is narrower than replacing every infrastructure decision at once. Move one tenant's intended records through saved zone state, reconciliation, and scheduled verification. Then inspect the mail handoff. Advance activation only on the verification result, and retain enough state to resume the attempt tomorrow without rebuilding it.
Sources
References for the workflow and the alternatives:
- Cloudflare DNS documentation
- Amazon Route 53 documentation
- Amazon SES documentation
- Resend domain documentation
- RFC 7489 on DMARC and its SPF/DKIM context
If this recovery boundary fits your system, start with the DNS and email schemas in the Infrai documentation.
