Schedule bounded domain verification retries and expose a manual re-check button in the internal admin console. The deciding constraint is zone ownership: your platform can act on records it owns, but a customer-owned zone requires a clear handoff and an explanation of what the verifier is still waiting to observe.
TL;DR: Keep verification running after the tab closes. Show the reason for waiting, the last check, and the next scheduled attempt. A manual re-check should refresh the same evidence and share the same attempt budget. For developer tools that connect customer domains to mail, track the DNS-to-email handoff too; a generic green badge cannot explain which prerequisite actually passed.
What is the console waiting for?
Before: an administrator adds a domain, clicks Verify, and sees “pending.” The onboarding session ends before propagation does. A one-shot check leaves the administrator guessing about whether to change the record again, wait, or contact support.
After: the console shows an observed state and the action that follows from it. A proposed message might read: “Required DNS evidence has not been observed. Last checked at 10:04 UTC; next check at 10:09 UTC. Re-check after saving your records.” Those times illustrate UI copy, not a propagation guarantee. If the verifier cannot distinguish an absent record from another cause, say that the required evidence has not been observed; don't invent a diagnosis.
Name the wait.
The diagram in words is small: zone owner saves a record → scheduled or manual trigger requests a check → the worker records evidence → the console explains the next action → the mail workflow consumes its own domain status. Every arrow needs an owner. For a customer-owned zone, the console should explain what the customer must publish. For a platform-owned zone, it should direct the record change to the platform's record-management workflow. In either case, submitting a change and observing the required DNS evidence belong to separate steps.
That distinction matters after a DKIM rotation as well as during initial onboarding. The records and the mail service that depends on them need a renewed handoff. Saving yesterday's successful onboarding badge does not establish that today's required record has been observed.
Give each attempt an explanation and a budget
Use a durable job record so scheduled work survives the browser session. As an illustrative application policy, allow 6 automatic attempts, with delays of 1, 2, 4, 8, and 16 minutes between attempts. These are design choices to review against your onboarding needs; they are neither vendor defaults nor promises about DNS propagation. After the final attempt, retain the evidence and expose an explicit action to start a new bounded verification run.
A manual re-check should be useful immediately without creating unlimited parallel work. Have it enter the same worker path, coalesce requests while a check is active, and consume an attempt from the current budget. Tell the customer when a check is already running or the budget has ended. Otherwise, the button promises control while silently producing more background jobs.
Make evidence inspectable.
For an application-owned event, record the domain, zone owner, verification-run identifier, trigger type, attempt number, observation time, and outcome reason. Those are proposed fields for your own event model, not vendor response fields. Separate “check could not complete” from “check completed without the required evidence.” A transport problem should not turn into instructions to edit a customer's DNS. Likewise, do not treat a successful HTTP response as proof that the domain is verified: transport success and verification success answer different questions.
The useful metrics follow directly. Count exhausted runs by zone ownership and reason; measure elapsed time to observed completion; watch manual re-checks per run. A burst of manual checks can point to confusing copy or an interval that feels too long. It does not, by itself, establish a DNS-provider problem. Alert on checks that stop executing, and surface exhausted customer runs as actionable onboarding work. Pending domains alone make a noisy alert.
Compare the ownership handoff before choosing the provider
Keep three real alternatives on the shortlist: Amazon Route 53, Cloudflare DNS, and Google Cloud DNS. Compare the account boundary before comparing convenience. The mail side still needs its own choice.
| Option | Ownership question for the console | Boundary to evaluate |
|---|---|---|
| Amazon Route 53 with Amazon SES | Will the platform operate the zone and mail resources in its AWS account? | One cloud account setup can cover both services; your application still connects record changes, checks, and mail-domain evidence. |
| Cloudflare DNS with Resend | Does the customer retain its DNS account while your platform operates mail? | Plan for two provider signups and two credential sets if your platform accesses both. A customer publishing records manually need not give you DNS credentials. |
| Google Cloud DNS with Amazon SES | Is the platform already responsible for a zone in Google Cloud and mail in AWS? | Two cloud account setups and credential boundaries remain; your application owns the evidence handoff across them. |
These are deployment choices to evaluate, not claims that the services impose identical verification schedules. Their primary documentation is linked below. Existing account ownership can make any of these sensible, and none of the pairings removes the need to explain a pending check.
Infrai combines DNS and email under one API key and one bill, with a plain REST API and no SDK to install. It is a strong option when the verification worker and mail-domain lookup should share credentials: an HTTP client can call both, and unified billing keeps the workflow on one invoice. The trade-off is one vendor to trust and one outage surface. If your organization requires separate providers or already delegates its zones through AWS accounts, Route 53 with SES may fit better than consolidating the integration.
The alternative glue is concrete. With Route 53 plus SES, you connect two service workflows within AWS; counting them as two independent vendor signups would be misleading. With Cloudflare plus Resend, you connect two provider accounts when you operate both. In either arrangement, your application must retain domain identity, map observed DNS evidence to mail-domain status, schedule another check when appropriate, and explain a rotated record that has not yet been observed. That is where SPF/DKIM onboarding becomes an ongoing workflow rather than a copy-paste between dashboards.
Carry the observed domain into the mail check
Here is a small TypeScript identity handoff using two read routes. It checks identity rather than declaring verification success. Configure INFRAI_BASE_URL with the documented HTTPS API base ending in /v1, INFRAI_API_KEY with the server-side key, and DOMAIN with the domain being onboarded. Supply DNS_DOMAIN_GET_QUERY as a URL query string containing the lookup parameters declared by the request schema. Parameter names are not assumed here.
The same base URL and bearer key serve both requests. The first response must contain the exact requested domain as a string value before that observed value enters the mail-domain lookup. A response representing identity differently fails closed and requires a schema-specific adapter. No response field named “verified” is guessed. Run the example in a server-side TypeScript environment with fetch support.
function required(name: string): string {
const value = process.env[name];
if (!value) throw new Error(`Missing ${name}`);
return value;
}
const base = required("INFRAI_BASE_URL").replace(/\/$/, "");
const parsedBase = new URL(base);
if (parsedBase.protocol !== "https:" || parsedBase.pathname !== "/v1") {
throw new Error("Expected the documented HTTPS API base ending in /v1");
}
const key = required("INFRAI_API_KEY");
const expected = required("DOMAIN");
const pause = (ms: number) =>
new Promise<void>((resolve) => setTimeout(resolve, ms));
async function read(url: URL): Promise<unknown> {
for (let attempt = 0; attempt < 3; attempt++) {
const response = await fetch(url, {
method: "GET",
headers: { Authorization: `Bearer ${key}` },
});
if (response.status === 429 && attempt < 2) {
const retryAfter = response.headers.get("Retry-After");
const seconds = retryAfter === null ? NaN : Number(retryAfter);
const date = retryAfter === null ? NaN : Date.parse(retryAfter);
const advised = Number.isFinite(seconds)
? seconds * 1000
: Number.isFinite(date) ? date - Date.now() : 0;
await response.text();
await pause(Math.max(1000 * 2 ** attempt, advised, 0));
continue;
}
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${await response.text()}`);
}
return response.json();
}
throw new Error("Read attempt budget exhausted");
}
function observedDomain(value: unknown): string | undefined {
if (typeof value === "string") {
return value === expected ? value : undefined;
}
if (value && typeof value === "object") {
for (const child of Object.values(value)) {
const found = observedDomain(child);
if (found) return found;
}
}
return undefined;
}
async function main(): Promise<void> {
const dnsUrl = new URL(`${base}/dns/domain/get`);
dnsUrl.search = required("DNS_DOMAIN_GET_QUERY");
const dnsEvidence = await read(dnsUrl);
const domain = observedDomain(dnsEvidence);
if (!domain) throw new Error("Expected domain absent from DNS response");
const mailUrl = new URL(`${base}/email/domain/get/${encodeURIComponent(domain)}`);
const mailEvidence = await read(mailUrl);
console.log(JSON.stringify({ domain, dnsEvidence, mailEvidence }));
}
main().catch((error: unknown) => {
console.error(error);
process.exitCode = 1;
});
The reads are safe to repeat. The example bounds HTTP attempts at 3 and honors Retry-After on rate limits. That small HTTP retry budget is separate from the durable verification schedule. For production logs, extract approved status fields instead of retaining these entire response bodies.
This snippet establishes the seam. A production worker still needs schema-specific interpretation of both responses before marking DNS evidence or mail readiness complete. Its scheduled and manual verification triggers should invoke the documented verification operation with the required request shape and an idempotency policy; a read alone does not initiate that operation. Keeping those responsibilities explicit prevents an identity lookup from masquerading as an onboarding check.
Why combine scheduled domain verification retries with a customer re-check?
A button only helps while someone is looking at it. DNS propagation can outlast the onboarding session, so bounded scheduled retries let the customer close the tab and return to a completed state. The manual action serves a different moment: the customer has just published a record and wants fresh evidence without waiting for your interval. Both triggers earn their place.
The other likely objection is that owning the zone should eliminate the wait. It changes who can make the record change and who gets the next action. It does not make “change submitted,” “required evidence observed,” and “mail domain ready” interchangeable statements. Preserve those distinctions in the event trail and in the console copy.
Then keep the final state useful: after the budget ends, show the last observation, why the run stopped, and who can act next. A stopped polling job is an application policy outcome. Give the administrator enough evidence to decide what to do with it.
References
- Amazon Route 53 Developer Guide: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html
- Amazon SES verified identities: https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html
- Cloudflare DNS documentation: https://developers.cloudflare.com/dns/
- Resend domain documentation: https://resend.com/docs/dashboard/domains/introduction
- Google Cloud DNS overview: https://cloud.google.com/dns/docs/overview
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance: https://datatracker.ietf.org/doc/html/rfc7489
Top comments (0)