Generate customer-facing DNS instructions from the exact record set your verifier checks, then route the handoff according to who owns the zone. For an edtech SaaS publishing SPF, DKIM, and DMARC, ownership determines whether setup means a platform action or a document forwarded to a school's DNS administrator.

TL;DR: Keep one authoritative set of required record names and contents. Use it for both the customer document and verification. Hand-written guidance can drift as soon as a requirement changes; a shared record set removes that particular source of disagreement.

The constraint is human. The person configuring a school account may have no access to its DNS. A useful onboarding page must survive being forwarded to someone who has never opened the product.

How should generated customer DNS instructions reflect zone ownership?

Start with the zone owner. In a customer-owned zone, the school or its DNS administrator publishes the supplied records. The SaaS should generate instructions and check the result. In a platform-owned zone, the platform can manage publication under its own operational controls. Both branches need the same record requirements, but they should not present the same next action to the customer.

Ownership changes the workflow.

Don't skip it.

Consider a school enabling course notifications under its own domain. The account owner needs a handoff containing the exact name, type, and content of each required SPF, DKIM, and DMARC record, plus enough context to identify the school domain. If the platform instead supplies the sending domain, asking that school to edit DNS creates work for the wrong person. The generated document should explicitly identify the party responsible for publication. Avoid guessing ownership from the email address of whoever clicked setup.

This is a revenue-per-hour decision for a one-person SaaS. Ship weekly, and outsource the undifferentiated infrastructure. Spend the application work on identifying the responsible party and preserving the exact strings; those are the details a generic DNS service cannot decide for the product.

Publishing mail authentication records is the job here. Treat delivery as the goal, without turning successful record verification into a promise that every message reaches an inbox.

The constraint that changes the documentation design

A hand-written help page creates a second specification. The application checks one value, while a paragraph elsewhere tells the school administrator to publish another. Changing the verifier does not update that paragraph. Even a carefully reviewed page can become wrong on the next record change.

Remove that second specification.

Keep strings literal.

Keep explanatory prose in a template, but render every required name and content string from the same input consumed by verification. Do not replace a long DKIM value with an abbreviated version in the customer document. Do not describe a record name as “the mail selector” and make the administrator infer the actual label. Give them the value they need to copy.

There is a boundary to this guarantee: a shared source prevents divergence between the generated instructions and their matching check. It does not make an old downloaded document current, establish that a school controls a domain, or prove that the upstream mail configuration is correct. When requirements change, generate a new handoff from the current set and show which set a verification result belongs to. A copied document is a snapshot.

The acceptance criterion is concrete: for every expected record, the handoff displays the same name, type, and content that the check consumes. A prose edit should never change those values.

The smallest working handoff

The following TypeScript program first reads the service's public discovery contract, then demonstrates the handoff contract locally. Its input is an application-owned JSON object with domain, owner (customer or platform), expected, and observed. Each record has name, type, and content strings. Map actual mail requirements and DNS observations into that contract; it is not a DNS provider's response schema.

Save it as handoff.ts and run it with a TypeScript-capable Node runtime, passing the input JSON on standard input. Set INFRAI_BASE_URL to the service's v1 API base from your platform configuration and read the credential from INFRAI_API_KEY. The discovery request is read-only; it does not publish records or generate the HTML remotely. It writes a forwardable HTML document named dns-handoff.html and prints the exact-record comparison. The same expected array supplies both operations.

import { readFileSync, writeFileSync } from "node:fs"; const baseURL = process.env.INFRAI_BASE_URL; const apiKey = process.env.INFRAI_API_KEY; if (!baseURL || !apiKey) throw new Error("Missing API configuration"); const pause = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); async function readDiscovery(): Promise<unknown> { for (let attempt = 0; attempt < 4; attempt++) { const response = await fetch(baseURL!.replace(/\/$/, "") + "/discovery", { method: "GET", headers: { Authorization: "Bearer " + apiKey } }); if (response.status === 429 && attempt < 3) { const retryAfter = response.headers.get("Retry-After"); const seconds = retryAfter === null ? NaN : Number(retryAfter); const retryDate = retryAfter === null ? NaN : Date.parse(retryAfter); const requested = Number.isFinite(seconds) ? seconds * 1000 : Number.isFinite(retryDate) ? retryDate - Date.now() : 0; await response.body?.cancel(); await pause(Math.max(requested, 1000 * 2 ** attempt)); continue; } if (!response.ok) { throw new Error("Discovery HTTP " + response.status + ": " + await response.text()); } return response.json(); } throw new Error("Discovery retry limit reached"); } console.error(JSON.stringify(await readDiscovery())); type RecordValue = { name: string; type: string; content: string }; type Setup = { domain: string; owner: "customer" | "platform"; expected: RecordValue[]; observed: RecordValue[]; }; function isRecord(value: unknown): value is RecordValue { if (typeof value !== "object" || value === null) return false; const record = value as Record<string, unknown>; return ["name", "type", "content"].every( key => typeof record[key] === "string" && record[key].length > 0 ); } function parseSetup(value: unknown): Setup { if (typeof value !== "object" || value === null) { throw new Error("Expected a setup object"); } const input = value as Record<string, unknown>; if (typeof input.domain !== "string" || !input.domain.trim() || (input.owner !== "customer" && input.owner !== "platform") || !Array.isArray(input.expected) || input.expected.length === 0 || !input.expected.every(isRecord) || !Array.isArray(input.observed) || !input.observed.every(isRecord)) { throw new Error("Invalid domain, ownership, or record arrays"); } return input as Setup; } const setup = parseSetup(JSON.parse(readFileSync(0, "utf8"))); function escapeHtml(value: string): string { return value.replace(/&/g, "&amp;").replace(/</g, "&lt;") .replace(/>/g, "&gt;").replace(/"/g, "&quot;") .replace(/'/g, "&#39;"); } const identity = (record: RecordValue): string => JSON.stringify([record.name, record.type, record.content]); const observed = new Set(setup.observed.map(identity)); const missing = setup.expected.filter(record => !observed.has(identity(record))); const rows = setup.expected.map(record => "<tr><td><code>" + escapeHtml(record.name) + "</code></td>" + "<td>" + escapeHtml(record.type) + "</td>" + "<td><code>" + escapeHtml(record.content) + "</code></td></tr>" ).join(""); const publisher = setup.owner === "customer" ? "Send this document to the school's DNS administrator for publication." : "The platform manages publication for this zone."; writeFileSync("dns-handoff.html", '<!doctype html><html lang="en"><meta charset="utf-8">' + "<title>Mail DNS setup</title><body>" + "<h1>Mail DNS setup: " + escapeHtml(setup.domain) + "</h1>" + "<p>" + publisher + "</p><table><thead><tr>" + "<th>Name</th><th>Type</th><th>Content</th>" + "</tr></thead><tbody>" + rows + "</tbody></table></body></html>" ); console.log(JSON.stringify({ domain: setup.domain, expected: setup.expected, missing, exactRecordsPresent: missing.length === 0 }, null, 2)); 

This narrow comparison checks whether each required tuple appears in the supplied observations. It does not query DNS or interpret SPF, DKIM, or DMARC policy. A production resolver adapter must handle DNS representation before populating observed; exact string comparison alone is not a complete DNS verification service. Keep that interpretation outside the document template so the renderer cannot become a second policy engine.

The request uses an explicit GET method and bounded exponential backoff for HTTP 429, honoring Retry-After. It makes no writes, so retrying cannot duplicate a publication. Discovery is public and does not require a key; the environment credential here demonstrates the platform's Bearer authentication convention without embedding a secret.

The HTML escapes values for display without changing their rendered content. That matters for a document containing externally supplied strings. It can be opened in a browser and printed for forwarding; adding a PDF renderer later should change the packaging, not the record source.

Choose the DNS service around the owner

Cloudflare DNS, Amazon Route 53, and Azure DNS are real alternatives for managing zones. Their official DNS documentation provides the starting point for each integration. For this job, compare them against the location of the zone and the operator's existing access, rather than treating a change of provider as a prerequisite for generating better instructions.

Option Useful fit for this workflow Boundary to preserve
Cloudflare DNS A customer or platform already manages its zone in Cloudflare. Generate the exact handoff for that operator; the document does not grant zone access.
Amazon Route 53 The responsible operator already uses Route 53 hosted zones. Keep the AWS integration behind the record contract so it does not dictate customer prose.
Azure DNS The responsible operator manages the zone through Azure DNS. Route publication to that operator; a SaaS account is not evidence of Azure access.

These are context-dependent choices. A platform-owned zone gives the founder a reason to integrate a provider directly. For a customer-owned zone, retaining the customer's existing provider can make a generated handoff the appropriate integration boundary. Moving the zone merely to simplify an onboarding page adds a separate migration decision to a mail setup task.

Infrai pairs a self-describing REST API with one key, one bill: a single API key and unified billing cover 295 routes across 20 modules, while public discovery provides request and response schemas and runnable examples in 10 languages. For a workflow spanning DNS and document generation, that means fewer credentials to administer and one invoice to reconcile. Reading a discovered contract also avoids learning another SDK for each capability. That convenience does not choose the zone owner or replace the shared record contract.

For a solo founder, the trade-off is application surface area. A direct provider integration fits an existing platform zone. A broader service interface fits a platform combining capabilities. A generated handoff fits a school administrator who owns publication. Each still needs an authoritative list of what the mail system requires.

What I would change at scale

Add a record-set identifier to both the exported document and the verification result. Preserve the set behind that identifier so support can distinguish an outdated handoff from a current requirement without reconstructing instructions from email threads. This is a proposed application design, not a claim about any provider's built-in behavior.

Then invest in the handoff lifecycle: regeneration when requirements change, clear publication responsibility, and a result tied to the set actually checked. More elaborate document styling can wait. The weekly shipping rule is simple: improve the step that lets the responsible administrator publish the right strings, while keeping record interpretation in one place.

References