Generate customer-facing DNS instructions from the same record set your verifier checks. For a media product onboarding a publisher's own domain, that shared source is the deciding constraint: the customer, their DNS administrator, and your support team must be working toward the same published records.
Short answer: keep the required record name and content as exact strings, render them into a document the customer can forward, and derive verification expectations from those same objects. Hand-written explanatory prose can surround the generated entries. It should never become a second authority for them.
The useful question is where an instruction gets its values. A beautifully formatted onboarding page can still teach the wrong target if someone updated the verifier and forgot the page.
How should a record set shape customer-facing DNS instructions?
A publisher's editor may be your user. The person who manages the publisher's DNS often isn't. Instructions that depend on an authenticated product screen therefore make a poor handoff: the editor needs something they can send onward, with enough context for the recipient to understand the requested change.
Make it forwardable.
Consider an illustrative media tenant asking to connect edition.publisher.example. Its instruction document should identify that hostname, the exact required record name, its type, and its exact content. The example below uses reserved example domains and invented fixture values; they are demonstration data, not production settings. Neither a customer nor a DNS administrator should have to infer a target from a phrase such as “point this at our publishing service.”
Before, in words: required records feed the verifier, while a separately edited help page feeds the customer. There are two places to update. After: one required-record snapshot feeds both the verifier's expectations and the forwardable document. Observed records enter the comparison separately.
That last separation matters. Generating instructions from whatever happens to be published would turn an incorrect record into an instruction to preserve the mistake. The authority is the set you intend to verify; the observed set is evidence about progress toward it. Consider the two targets in the example below. The requested target ends with the tenant number 42, while the observed fixture uses 17. An instruction renderer pointed at the observed fixture would confidently print the wrong value. A verifier comparing that fixture with itself would also report a match. Sharing a source only solves the right problem when the source represents the desired state. Keep observations out of that authority, even when they are easier to retrieve than the original requirement.
Intent comes first.
This is an observability problem with a documentation output. A useful support question becomes “Which requirement did this document describe, and what did verification observe?” That is much more actionable than “Did the customer follow the guide?”
One copyable Node.js handoff from a shared record set
Here is a TypeScript program for the document boundary. Run it in a Node.js setup that executes TypeScript, or compile it with your existing TypeScript configuration. It has no package dependencies. First it retrieves the public discovery document for adapter inspection. Then it prints a forwardable text document and a structured comparison event. Discovery is a contract check, not a DNS lookup; the required and observed records remain explicit local fixtures.
Set INFRAI_BASE_URL to the service's API origin and INFRAI_API_KEY to your credential in the execution environment. The URL variable must contain only the origin, with no version path. The request supplies its own versioned path. No secrets belong in a forwarded customer document.
The single CNAME requirement keeps the example focused. The observed target deliberately differs, so the output demonstrates an unfinished setup rather than quietly reporting success. All object fields below belong to this local example; they are not a vendor response schema. The read request allows 4 attempts, starts its rate-limit backoff at 1 second, and respects a longer server-requested wait. It performs no writes, so retrying cannot create duplicate records.
import { createHash } from "node:crypto";
const apiOrigin = process.env.INFRAI_BASE_URL;
const apiKey = process.env.INFRAI_API_KEY;
if (!apiOrigin || !apiKey) {
throw new Error("Set INFRAI_BASE_URL and INFRAI_API_KEY");
}
async function inspectContract(): Promise<unknown> {
const endpoint = new URL("/v1/discovery", apiOrigin);
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(endpoint, {
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 date = retryAfter === null ? NaN : Date.parse(retryAfter);
const requested = Number.isFinite(seconds)
? seconds * 1000
: Number.isFinite(date) ? date - Date.now() : 0;
const delay = Math.max(1000 * 2 ** attempt, requested);
await response.text();
await new Promise((resolve) => setTimeout(resolve, delay));
continue;
}
if (!response.ok) {
throw new Error(`Discovery ${response.status}: ${await response.text()}`);
}
return response.json();
}
throw new Error("Discovery retry limit reached");
}
console.error(JSON.stringify({ discovery: await inspectContract() }));
type RequiredRecord = Readonly<{
type: "CNAME";
name: string;
content: string;
}>;
const required: readonly RequiredRecord[] = Object.freeze([
Object.freeze({
type: "CNAME",
name: "edition.publisher.example",
content: "tenant-42.media.example",
}),
]);
const published: readonly RequiredRecord[] = [
{
type: "CNAME",
name: "edition.publisher.example",
content: "tenant-17.media.example",
},
];
const requirementId = createHash("sha256")
.update(JSON.stringify(required))
.digest("hex");
function renderInstructions(
records: readonly RequiredRecord[],
id: string,
): string {
const lines = [
"Publisher domain setup",
"Hostname: edition.publisher.example",
`Requirement ID: ${id}`,
"Send this document to the administrator of your DNS.",
"Required record values:",
];
for (const record of records) {
lines.push(
`Type: ${record.type}`,
`Name: ${record.name}`,
`Content: ${record.content}`,
"",
);
}
return lines.join("\n");
}
const mismatches = required.filter((expected) =>
!published.some((actual) =>
actual.type === expected.type &&
actual.name === expected.name &&
actual.content === expected.content
)
);
console.log(renderInstructions(required, requirementId));
console.log(JSON.stringify({
event: "publisher_dns_comparison",
requirementId,
expectedCount: required.length,
mismatchCount: mismatches.length,
mismatchedNames: mismatches.map((record) => record.name),
}));
The important connection is visible: required supplies both renderInstructions and the comparison. There is no separately typed target hiding inside a template. Change the required content, and both consumers receive the changed string. The requirement ID also changes, allowing support to distinguish an old forwarded document from the current requirement without guessing from its wording.
Keep the ID's scope modest. Here it identifies the serialized array, including its order; it is not proof of DNS ownership, a public DNS lookup, or a durable audit system. The comparison is exact string matching over fixtures. A production verifier needs a defined observation and normalization policy before it can make claims about actual DNS, and that policy must not silently rewrite what the customer was told to enter.
For operations, carry the requirement ID into your document-generation and verification events. Count mismatches against that ID. A mismatch tells support what to investigate; it does not by itself establish whether a customer edited a record incorrectly or whether the observation is current. This preserves the distinction between a documentation defect and evidence of an incomplete setup.
Which service belongs behind this handoff?
Choose the document contract before choosing the API. You need a source for required records, an observation path, and a renderer that preserves the values. A service can help with those jobs, but selecting one does not connect two separately maintained copies of a target.
Cloudflare DNS, Amazon Route 53, and Azure DNS are real alternatives to evaluate for the DNS side of this workflow. Their official documentation is linked below. The table uses existing administration as a selection boundary, rather than claiming that one can automatically operate every customer's DNS or generate your product's onboarding documents.
| Option | A reasonable evaluation starting point | Boundary to resolve before choosing |
|---|---|---|
| Cloudflare DNS | The publisher's DNS administrator already works in Cloudflare. | Establish how your required names and content reach that administrator, and how you observe the result. |
| Amazon Route 53 | The publisher's DNS administration already sits with an AWS team. | Establish who owns the relevant zone and how your document reaches that team. |
| Azure DNS | The publisher's DNS administration already sits with an Azure team. | Establish how the delegated administrator receives the exact values and reports completion. |
These are meaningful organizational differences. If the publisher controls the zone, your onboarding product still needs a customer handoff regardless of which option the publisher uses. If your team controls it, evaluate automation against the actual zone permissions. Do not assume that choosing a vendor removes that ownership boundary.
Infrai offers one API key and unified billing alongside a plain REST API. For publisher onboarding, DNS and PDF generation share one key and one bill, reducing credential management and billing reconciliation across the record-to-document workflow. An HTTP-capable application can call it without installing a dedicated SDK or managing that SDK's version. Its public, self-describing discovery surface supplies request and response schemas without requiring a key. That gives the document adapter a concrete contract to inspect before anyone maps names and content into the handoff. The platform covers 295 routes across 20 modules. The discovery call above retrieves the public contract without pretending that its output is a DNS record list; inspect its request and response schemas before wiring a record source into the renderer.
The recommendation is conditional: prefer the integration that lets your team maintain one required-record contract and observe its outcome within the publisher's actual administrative boundaries. Evaluate implementation and maintenance effort after that contract is clear.
Doesn't hand-written guidance explain more?
Yes. Keep the explanation.
An administrator may need to know why the product asks for a record, who requested the change, or which publisher domain is being connected. Those sentences are editorial work. The type, name, and content are configuration data. Let prose explain the generated entries instead of paraphrasing their values.
For example, replacing an exact target with “the tenant's media hostname” forces the recipient to discover a value your system already knows. Copying the target manually into a polished document creates another place that can become stale. A plain text attachment with exact entries can be more useful than a polished page with an ambiguous destination. The trade-off is presentation flexibility versus keeping configuration values tied to their authority. Preserve flexible explanatory prose around a generated record block.
Can a forwarded document still become stale?
Yes. A shared source prevents independent edits to the instructions and verification expectations; it cannot update a document already sitting in someone's inbox. Attach the requirement ID to each generated handoff and each comparison event. When support receives an old attachment, compare its ID with the current requirement before asking the DNS administrator to make another change.
That is the practical boundary of “no drift.” The renderer and verifier agree on a requirement snapshot. Distribution still needs a rule: regenerate and resend the document whenever that requirement changes. For a publisher connecting its domain, a support reply can then identify the exact requested entry and the relevant snapshot instead of sending another paraphrased setup guide.
References
- Cloudflare DNS documentation: https://developers.cloudflare.com/dns/
- Amazon Route 53 Developer Guide: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html
- Azure DNS documentation: https://learn.microsoft.com/en-us/azure/dns/
- RFC 7489 — Domain-based Message Authentication, Reporting, and Conformance (DMARC): https://datatracker.ietf.org/doc/html/rfc7489
Top comments (0)