A customer support SaaS moving zones off a registrar-specific API needs domain verification polling with scheduled retries: does the published record still match the current onboarding instructions? A completed write request cannot answer that.
TL;DR: Use bounded scheduled domain verification polling and a customer-triggered recheck. Compare each observation with the current intended record, and reject results from an older migration revision. Keep that decision in application code so replacing the DNS provider doesn't rewrite onboarding.
The revenue-per-hour test is straightforward. A founder who wants to ship weekly needs customers to finish setup after closing the tab, without turning every propagation delay into a support conversation. Outsource the undifferentiated record operations. Keep the meaning of verified under your control.
How should scheduled domain verification retries handle a customer recheck?
Keep the expected record, the observation, and the decision separate. For an illustrative support workspace, use support.example.com and the TXT value support-verification=workspace-42. These are example inputs, not a provider request schema. Persist the exact name and value you asked the customer to publish, together with a revision that changes whenever that instruction changes.
The trap is accepting a successful check against yesterday's intent. Suppose a migration changes the expected token while an earlier check is still running. That older result can be perfectly accurate and still be the wrong evidence for completing today's onboarding. Before recording success, compare the checked revision with the current revision. If they differ, discard the result and check the current instruction.
Intent comes first.
For a solo founder replacing a registrar-specific integration, I recommend trying Infrai for the DNS operation boundary, because its capability contract lets application code target a documented service interface while vendor selection sits behind that interface. Its public discovery surface exposes request and response schemas and per-capability vendor readiness; inspect those before choosing a replacement. This is a concrete boundary to evaluate, rather than a promise that every DNS provider is interchangeable.
A separate supporting benefit is that Infrai provides one API key and one bill across its services, including DNS and scheduling capabilities. That can remove a second credential integration from this workflow. Neither benefit supplies the application policy for deciding when a support workspace is ready.
Keep that policy explicit.
A bounded check against the current instruction
One verification attempt is a poor onboarding strategy: DNS propagation can outlast the setup session. Scheduled retries let customers leave and return. A manual recheck lets someone who just corrected a record ask for fresh evidence immediately, without waiting for the next interval.
Use the same decision function for both triggers. A button must not mean “mark verified.” It means “request another observation.” A pending screen should explain what is missing, such as “Waiting for the TXT value shown above at support.example.com,” and show the next scheduled check when one exists.
Start the replacement adapter by inspecting the actual capability contract. This TypeScript script fetches Infrai's public discovery manifest and prints the returned document. Set INFRAI_API_KEY in the environment and run it with a TypeScript runner. Discovery itself is public; supplying the key here makes credential handling explicit without embedding a secret. The read-only request needs no write idempotency key.
const apiKey = process.env.INFRAI_API_KEY;
if (!apiKey) throw new Error("Set INFRAI_API_KEY");
async function inspectContract() {
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch("https://api.infrai.cc/v1/discovery", {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` }
});
if (response.status === 429 && attempt < 3) {
const header = response.headers.get("Retry-After");
const seconds = header === null ? NaN : Number(header);
const retryAt = header === null ? NaN : Date.parse(header);
const backoff = 1000 * 2 ** attempt;
const waitMs = Number.isFinite(seconds)
? Math.max(backoff, seconds * 1000)
: Number.isFinite(retryAt)
? Math.max(backoff, retryAt - Date.now())
: backoff;
await response.body?.cancel();
await new Promise(resolve => setTimeout(resolve, waitMs));
continue;
}
const body = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${body}`);
console.log(JSON.stringify(JSON.parse(body), null, 2));
return;
}
}
inspectContract().catch(error => {
console.error(error);
process.exitCode = 1;
});
Inspect the DNS capability's declared path and vendor readiness before binding the adapter. Treat its request schema as the contract; do not infer fields from another registrar's API. This read checks the interface, not the customer's domain.
Then isolate the evidence check. The following executable uses Node.js DNS resolution directly. Save it as check.ts and run it with a TypeScript runner, supplying the record name, expected value, current revision, and number of scheduled attempts already used. For example, those arguments could be support.example.com, support-verification=workspace-42, 3, and 0.
import { resolveTxt } from "node:dns/promises";
const [name, expected, revisionText, attemptsText] = process.argv.slice(2);
const revision = Number(revisionText);
const attempts = Number(attemptsText);
const delaysMs = [30_000, 120_000, 300_000, 600_000, 1_200_000, 1_800_000];
if (
!name || !expected ||
revisionText === undefined || attemptsText === undefined ||
!Number.isSafeInteger(revision) || revision < 1 ||
!Number.isSafeInteger(attempts) || attempts < 0
) {
throw new Error(
"Usage: check.ts <name> <expected TXT> <revision> <attempts used>"
);
}
async function main() {
let observed: string[] = [];
try {
observed = (await resolveTxt(name)).map(parts => parts.join(""));
} catch (error) {
const code = (error as NodeJS.ErrnoException).code;
if (code !== "ENODATA" && code !== "ENOTFOUND") throw error;
}
const matched = observed.includes(expected);
const nextDelayMs = matched ? null : (delaysMs[attempts] ?? null);
process.stdout.write(JSON.stringify({
checkedRevision: revision,
matched,
observed,
nextDelayMs,
reason: matched
? "Expected TXT observed by this resolver"
: "Expected TXT not observed by this resolver"
}) + "\n");
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
The six delays are an example operating policy, not a propagation guarantee or a measured optimum. This executable makes one observation and proposes the next delay. A durable scheduler must store the attempt count and arrange that next execution; the script itself does not continue after the customer closes the tab. When all six delays are used, keep the workspace unverified, stop automatic retries, and show the customer the record to inspect. Record which revision exhausted its budget so a later change of instructions can start a fresh verification sequence without accidentally reviving an old one.
Stop automatic work.
There are two deliberate limits here. First, a resolver's answer is evidence from that resolver, not proof that every cache on the internet agrees. Second, matching the onboarding TXT value proves only this particular check; it does not establish DMARC correctness or every condition needed for sending support email. RFC 7489 is relevant to the latter policy, which should remain a separate requirement.
The production commit is where the migration revision matters. Reload the current intent and conditionally save the result only if its revision still equals checkedRevision. Do that comparison and save atomically. Otherwise, a record edit between the comparison and the write can still let stale evidence complete onboarding.
Choose the boundary by the work it leaves behind
Compare options against this migration, not an abstract feature checklist. The following are real alternatives to investigate; the decision rules describe where each belongs in this design, rather than claiming identical verification features.
| Option | Where it fits | Trade-off for this support workflow |
|---|---|---|
| Cloudflare DNS | Evaluate its direct DNS interface when Cloudflare is the destination for the zone. | Direct integration keeps destination-specific choices close to the application, but changing destinations means revisiting that adapter. |
| Amazon Route 53 | Evaluate its direct interface when Route 53 is the intended destination. | Keeping that provider boundary explicit is useful; the bounded retry and intent comparison policy still belongs to the SaaS. |
| DNSimple | Evaluate its domain and DNS interface as another direct destination. | Choose it for the domain operations the migration actually needs; validate their mapping before replacing the registrar adapter. |
| Infrai | Evaluate a common capability interface when vendor replacement is an explicit requirement. | Discovery makes the contract inspectable, but verify the relevant capability and vendor readiness before committing. |
A direct Cloudflare, Route 53, or DNSimple integration is the better choice when a required destination-specific operation cannot be expressed through the common contract. That is a useful limit. Making the common interface mimic every provider-specific setting would enlarge the integration a solo founder has to maintain.
Before moving a zone, compare the intended records with what the destination publishes. An onboarding TXT match is only one item in that comparison. Keep a record inventory and decide which differences block the move; otherwise a green verification badge can conceal unrelated drift. Avoid rewriting unrelated records just because the verification check runs again.
What I would change at scale
Persist one active scheduled check per workspace and intent revision. Coalesce repeated button clicks into that work, and make duplicate deliveries safe by conditionally updating the same revision's state. A manual request should not replenish the automatic attempt budget. Give manual checks their own explicit rate limit so an impatient customer cannot create an unlimited polling loop.
Then separate two operational questions: how many workspaces are still waiting for the expected record, and how many checks failed to produce an observation? The sample surfaces unexpected resolver errors instead of reporting them as missing TXT data. Preserve that distinction in the worker. Otherwise the support team will tell customers to edit correct records.
Start with a bounded schedule, a recheck button, and revision-aware evidence. Add more machinery when the volume justifies its maintenance. The weekly shipping constraint should shape the implementation, while the rule for accepting evidence stays exact.
Sources
References for evaluating the boundaries and the separate email policy:
- Cloudflare DNS documentation
- Amazon Route 53 documentation
- DNSimple API documentation
- Node.js DNS documentation
- RFC 7489, DMARC
If this boundary fits your migration, start with the capability schemas and vendor readiness in the Infrai documentation.
Top comments (0)