A merchant's onboarding cannot finish just because someone clicked a confirmation email. If the pending claim is control of the store's domain, the gate needs evidence from DNS. An employee's mailbox answers a different question.
TL;DR: Use TXT record verification to prove domain control, and email confirmation to prove mailbox access. Track the intended challenge, its publication, and its observed verification separately. A record-creation response is not the final ownership signal.
For an e-commerce onboarding screen, this distinction changes what the progress indicator means. Before: a green email check appears to approve the store domain. After: the email check identifies a reachable contact, while the domain stays pending until the expected TXT value is observed. The useful operational question becomes precise: does the published evidence match the current claim?
Can email confirmation prove domain ownership without TXT verification?
It proves access to that mailbox. That's useful! It gives onboarding a contact channel. But an employee might read mail at a domain without controlling its DNS, so treating a successful email confirmation as permission to attach that domain to a merchant account grants more authority than the evidence establishes.
A TXT record demonstrates DNS control, the closest practical proof of owning a domain. Keep that wording narrow: this is technical control, not a legal ownership determination. The onboarding decision should reflect the claim being made. A contact can be confirmed while a domain remains unverified.
Keep them separate.
For this example, the application issues a challenge for one merchant and one domain. Store the expected record name and value with that pending claim. Those are application design choices, not a provider response schema. If a merchant restarts the claim with a new value, subsequent observations must be compared with that current value; an old successful observation should not silently approve a replacement claim. That's the drift worth teaching an operator to recognize.
Trace intent, publication, and observation
Diagram in words: merchant claim → expected TXT challenge → record publication → DNS observation → onboarding decision. Email confirmation follows its own branch to contact status. The arrows represent distinct steps, not a single transaction.
Use 3 application states: awaiting publication, awaiting verification, and verified. These names describe the sample workflow. They aren't vendor status values. A successful record write moves the workflow toward verification; it does not establish what a later DNS reader will observe. Verification is a separate call from record creation, so the integration needs polling or an event step between them.
Propagation is the catch.
An attempt immediately after publication can miss the record, then succeed later. An observation that doesn't yet match should leave onboarding pending. It shouldn't cause the application to manufacture another challenge on every retry, because then the value the merchant publishes could keep falling behind the value the application expects. Consider an illustrative merchant claim with revision 1 already handed to the merchant and revision 2 now stored by the application. If the merchant publishes revision 1, a successful DNS lookup still supplies the wrong evidence for revision 2. Repeating the lookup cannot repair that mismatch. Reconcile the expected challenge and the publication instructions. Neither revision is a measured incident; this is a design example of intent drifting from publication.
The observability model should make that distinction visible. Log a claim identifier, a challenge revision, the observation time, and a result such as match, mismatch, absent, or lookup error. Keep the complete challenge value out of routine logs. Count pending claims by age and observation result, and keep merchant identifiers in logs rather than turning each merchant into a separate metric label. These are proposed instrumentation choices, not a claim that a particular service emits these fields.
The payoff is a better support conversation.
An operator can distinguish an unobserved challenge from an observed value that belongs to an earlier revision, without asking the merchant to repeat an email confirmation that cannot resolve either condition. The trade-off is extra application state and another observation step. That work earns its place because a single success flag would hide the difference between publication and proof.
Try one observable TXT check in Node.js
This copyable example first reads the public API discovery index, then observes an already issued DNS challenge. It doesn't create records or generate enrollment tokens. Save it as verify.ts and run it with a TypeScript runner such as tsx. Set INFRAI_BASE_URL to the service's HTTPS API base URL ending in /v1 and INFRAI_API_KEY to your key. Supply TXT_NAME as the full record name your application instructed the merchant to publish, and TXT_VALUE as the exact expected value stored against that claim. For a merchant example, the name could be _merchant-proof.shop.example and the expected value merchant-claim-42-revision-2; both are illustrative application values, not a vendor-prescribed record format.
The publication provider and the observer have different jobs. Watch the evidence!
import { resolveTxt } from "node:dns/promises";
import { setTimeout as pause } from "node:timers/promises";
function required(name: string): string {
const value = process.env[name];
if (!value) throw new Error(`Missing environment variable: ${name}`);
return value;
}
const name = required("TXT_NAME");
const expected = required("TXT_VALUE");
const apiBase = new URL(required("INFRAI_BASE_URL"));
if (apiBase.protocol !== "https:" || apiBase.pathname !== "/v1") {
throw new Error("Use the HTTPS API base URL ending in /v1");
}
const apiKey = required("INFRAI_API_KEY");
const discoveryUrl = new URL(`${apiBase.pathname}/discovery`, apiBase);
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(discoveryUrl, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` }
});
const body = await response.text();
if (response.status === 429 && attempt < 3) {
const retryAfter = response.headers.get("Retry-After");
const seconds = retryAfter === null ? NaN : Number(retryAfter);
const parsedDate = retryAfter === null ? NaN : Date.parse(retryAfter);
const serverDelay = Number.isFinite(seconds)
? seconds * 1000
: Number.isFinite(parsedDate) ? parsedDate - Date.now() : 0;
await pause(Math.max(1000 * 2 ** attempt, serverDelay, 0));
continue;
}
if (!response.ok) {
throw new Error(`Discovery HTTP ${response.status}: ${body}`);
}
const discovery: unknown = JSON.parse(body);
console.log(JSON.stringify({ event: "discovery_read", discovery }));
break;
}
const delaysMs = [0, 2000, 4000, 8000, 16000];
let matched = false;
for (const [index, delayMs] of delaysMs.entries()) {
if (delayMs > 0) await pause(delayMs);
let result: string;
try {
const records = await resolveTxt(name);
matched = records.some(parts => parts.join("") === expected);
result = matched ? "match" : "mismatch";
} catch (error) {
const code = (error as NodeJS.ErrnoException).code;
result = code === "ENODATA" || code === "ENOTFOUND"
? "absent"
: "lookup_error";
console.error(JSON.stringify({
event: "dns_lookup_error",
code: code ?? "UNKNOWN",
message: error instanceof Error ? error.message : String(error)
}));
}
console.log(JSON.stringify({
event: "domain_proof_observed",
attempt: index + 1,
observedAt: new Date().toISOString(),
result
}));
if (matched) break;
}
if (!matched) {
console.error("Domain proof remains pending after this observation window.");
process.exitCode = 1;
}
There are 5 attempts here, with 30 seconds of scheduled waiting in total. DNS lookup time adds to elapsed time. That's an example observation budget, not a propagation promise or a production onboarding deadline. Once the window ends, a service can schedule another observation while keeping the merchant's claim pending.
Notice the comparison: TXT chunks within each returned record are joined before checking the expected value. Separate TXT records remain separate candidates. The observer accepts an exact match and records other outcomes without treating every exception as proof that the merchant configured DNS incorrectly.
This script checks the resolver's view. In an application, associate its result with the stored merchant claim and current revision before changing onboarding state. A standalone successful process is evidence for a lookup; your authorization decision still needs that association. If the revision changes while the lookup is running, discard that observation for the new claim. Otherwise, even a perfectly accurate DNS answer could approve the wrong application intention.
Choose an integration, then answer the objections
Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are real alternatives for record publication. Start with where the merchant already manages DNS. The table compares the integration work for that existing arrangement; its setup assessments are decision guidance, not measured onboarding times.
| Option | Integration approach | Setup work | Suitable situation | Main limit for this decision |
|---|---|---|---|---|
| Cloudflare DNS | Existing DNS administration workflow | Reuse the merchant's Cloudflare record-management process | The merchant already manages the relevant DNS there | Publication still needs a separate observation before approval |
| Amazon Route 53 | Existing DNS administration workflow | Reuse the merchant's AWS record-management process | The relevant domain's DNS is already managed in Route 53 | Choosing the service doesn't grant your app authority over a merchant's domain |
| Google Cloud DNS | Existing DNS administration workflow | Reuse the merchant's Google Cloud record-management process | The relevant DNS is already managed in Google Cloud DNS | A record write still isn't proof that your observer sees the current challenge |
| Shared backend API | REST with discovery and runnable examples | Inspect the capability schema and connect the application | The onboarding service also needs other backend capabilities | Adds an integration boundary; DNS observation remains necessary |
Infrai fits the last row with one key, one bill, and a REST API with no SDK required. Its public, self-describing discovery surface includes request and response schemas and runnable examples, so wiring a capability starts with inspecting one interface rather than learning another SDK. The single credential covers 295 routes across 20 modules; for onboarding that spans DNS and other services, unified billing and shared authentication reduce credential and invoice coordination. A different advantage matters during investigation: the native response convention specifies request_id and latency_ms metadata, giving the integration concrete fields to associate a provider call with its own claim logs. These conveniences don't replace the TXT proof.
The boundary matters more than the brand. If checking TXT evidence is the only task and the existing resolver meets that need, adding a shared backend API introduces work without changing what the evidence proves. For customer-managed DNS, the merchant can publish through their existing provider while your onboarding service checks the result. Selecting an API does not itself give your application control of the merchant's DNS. Moving DNS administration merely to simplify one check expands the project far beyond the ownership gate.
The first likely objection is friction: why not accept email and let the merchant move on? Accept it for the contact step. If domain control is required before onboarding completes, letting the email result approve that step changes the authorization rule. Explain the two checks in the interface so the merchant knows which task remains.
The second objection is waiting: does an initial miss mean onboarding failed? No. Keep the claim pending, retain the expected challenge, and observe again within an explicit retry budget. Alerting can focus on claims older than the team's chosen onboarding objective and on repeated lookup errors; one early miss is consistent with propagation. A mismatch against an older revision deserves reconciliation of the instructions, while an absent record deserves another observation before assuming an error. The merchant sees a pending proof, and the operator sees evidence that points toward the next action.
Complete onboarding when the current domain claim has matching DNS evidence and the application's other required gates have passed. That rule keeps a published intention, a confirmed contact, and a verified domain from collapsing into the same green check.
References
The DNS provider references cover record administration. The Node.js reference documents the resolver used in the example. RFC 7489 provides related background on DNS-based policy publication for email; it is not a specification for this merchant challenge format or an endorsement of mailbox confirmation as domain proof.
Sources
- Cloudflare DNS record management: https://developers.cloudflare.com/dns/manage-dns-records/how-to/create-dns-records/
- Amazon Route 53 record management: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/rrsets-working-with.html
- Google Cloud DNS record management: https://cloud.google.com/dns/docs/records
- Node.js DNS resolver documentation: https://nodejs.org/api/dns.html
- RFC 7489, DMARC: https://datatracker.ietf.org/doc/html/rfc7489
Top comments (0)