For a media publisher moving a customer hostname, publish a documented A record at the apex and a CNAME at www. Keep the previous destination available during the transition. The engineering decision is how much propagation delay the newsroom can tolerate before retiring the old destination.
Short answer: standard DNS does not permit an apex CNAME. An apex A record is the portable answer, but it couples the customer's zone to your infrastructure address. Supporting both the bare domain and www means maintaining two entry points, including a rollback plan for each. A successful record update alone does not establish that readers have reached the new destination.
How should customer domains support apex A records and www CNAME targets?
Before: customer zone → published record → previous destination. After: customer zone → updated record → new destination. During the transition, treat both paths as relevant. That's the diagram.
Consider an illustrative publication, example.com, with example.com as its apex and www.example.com as its second entry point. Its onboarding instructions should state the actual service address for the A record and the actual target hostname for the CNAME. Those values are operational commitments. An undocumented address invites a support conversation precisely when the newsroom needs a predictable change window.
The CNAME restriction has a structural reason. A zone apex already has DNS data required for the zone, while the CNAME rules prohibit other data at the same owner name. RFC 1034 describes that constraint. Do not teach customers to solve it by removing their zone's required records.
Address coupling matters.
When the service address changes, the customer must update the apex A record. A www alias can follow a target hostname, but that does not remove the separate obligation at the apex. Put the old and new values for both names in the change record, together with who controls the customer's DNS zone. Without that ownership detail, a rollback instruction may describe an edit your operator cannot actually perform.
Separate a write acknowledgment from reader arrival
Check both names.
Use an observability lens here: a control-plane acknowledgment and a reader reaching the intended destination are different signals. A record listing describes what the API returned. A request observed at the destination describes a request that actually arrived there. Neither should silently stand in for the other.
For the newsroom change, keep the hostname, intended destination, previous destination, observation time, and change identifier together in your own operational evidence. These are suggested application fields, not claims about a provider's response schema. Evaluate apex and www independently. An aggregate success rate can hide the situation where one entry point works and the other still needs attention.
Wait for evidence.
Avoid inventing a universal propagation deadline. The practical trade-off is straightforward: retaining the previous destination longer gives the transition more room, while retiring it earlier shortens the overlap your team must operate. Choose that overlap before editing records, then use observations to decide whether the change has met your release conditions. There is no measured propagation time here to justify a promise such as “all readers switch in 60 seconds.”
Keep both destinations.
The same distinction applies to rollback. Restoring the old record expresses a new DNS intent; it does not instantly move every reader back. Keep the destinations capable of handling the intended traffic while the rollback takes effect.
One copyable handoff for the change receipt
Infrai offers one key and one bill through a unified API: a simple REST API with no SDK to install. That single API lets the same HTTP client capture DNS and account evidence without separate service clients or credential sets. Public discovery is self-describing and requires no key, so the team can inspect request and response schemas before connecting the newsroom workflow. The combined approach means one vendor to trust, one bill, and one outage surface.
The useful seam is between the DNS change evidence and the account evidence attached to that change. The following TypeScript example reads the DNS record listing, fingerprints the exact returned body, and passes that fingerprint into an account-usage receipt function. Both reads use the same key and base URL. The fingerprint is local correlation data: it is not a provider verification token or a parameter sent to the account API.
Save this as change-receipt.ts and run it with a TypeScript-capable Node runtime. Set INFRAI_API_KEY to your backend key and BACKEND_BASE_URL to the documented HTTPS API base ending in /v1. The example deliberately prints a compact receipt rather than dumping DNS records and account data into a shared log. The two API bodies remain opaque because a record-management request should be built from the published schema, not guessed from an endpoint name.
import { createHash } from "node:crypto";
const key = process.env.INFRAI_API_KEY;
const configuredBase = process.env.BACKEND_BASE_URL;
if (!key || !configuredBase) {
throw new Error("Set INFRAI_API_KEY and BACKEND_BASE_URL");
}
const base = new URL(configuredBase);
if (base.protocol !== "https:" || base.pathname.replace(/\/$/, "") !== "/v1") {
throw new Error("Use the documented HTTPS API base ending in /v1");
}
if (base.username || base.password || base.search || base.hash) {
throw new Error("The API base must not contain credentials, query, or fragment");
}
const authorization = `Bearer ${key}`;
const digest = (body: string) =>
createHash("sha256").update(body).digest("hex");
const pause = (ms: number) =>
new Promise<void>((resolve) => setTimeout(resolve, ms));
async function read(path: string): Promise<string> {
const url = `${base.origin}${path}`;
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, {
method: "GET",
headers: { Authorization: authorization },
redirect: "error",
signal: AbortSignal.timeout(15000),
});
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 date = retryAfter === null ? NaN : Date.parse(retryAfter);
const requested = Number.isFinite(seconds)
? Math.max(0, seconds * 1000)
: Number.isFinite(date) ? Math.max(0, date - Date.now()) : 0;
const delay = Math.max(1000 * 2 ** attempt, requested);
if (delay > 2147483647) {
throw new Error("Retry-After requires a later scheduled retry");
}
await pause(delay);
continue;
}
if (!response.ok) {
throw new Error(`${path}: HTTP ${response.status}: ${body}`);
}
return body;
}
throw new Error("Retry limit reached");
}
async function attachAccountReceipt(dnsBodySha256: string) {
const usageBody = await read("/v1/account/usage");
return {
dnsBodySha256,
usageBodySha256: digest(usageBody),
capturedAt: new Date().toISOString(),
};
}
const dnsBody = await read("/v1/dns/record/list");
const receipt = await attachAccountReceipt(digest(dnsBody));
console.log(JSON.stringify(receipt));
This makes the handoff inspectable: the first response supplies the identifier included alongside the second response's fingerprint. Four attempts bound the retry loop, and Retry-After sets a minimum wait when present. These are read requests, so the example performs no DNS mutations and needs no write deduplication. A receipt records these particular reads; even an identical fingerprint does not establish that a particular customer hostname is verified.
Trigger this receipt from your application's change workflow. A record read and an account read do not require a recurring registrar poller. Keep verification evidence attached separately, using an integration whose actual notification contract you have checked. That prevents an accounting event from being mistaken for a domain-verification event.
Which provider boundary should the team own?
Compare control boundaries before comparing convenience. The portable A-at-apex and CNAME-at-www contract is the baseline in every evaluation. Provider-specific alias mechanisms need a separate compatibility check; the word “apex support” by itself does not tell a customer which records to publish.
| Option | What to evaluate for this newsroom change | Boundary to make explicit |
|---|---|---|
| Cloudflare for SaaS | A workflow organized around customer hostnames | Distinguish customer-hostname onboarding from authority over the customer's zone; verify the apex onboarding contract. |
| Amazon Route 53 | DNS record management in an AWS operating environment | Evaluate its alias-record model separately from a portable A-record instruction; establish who can edit each customer zone. |
| Google Cloud DNS | DNS record management in a Google Cloud operating environment | Check the record-management and customer-zone ownership workflow; a DNS record change still needs application-level arrival evidence. |
The first option plus an in-house poller has a concrete integration bill in engineering work. Budget one Cloudflare signup and one Cloudflare API credential set. If the poller runs in an existing application environment, it needs no additional provider signup; its runtime still needs access to that credential and somewhere to keep progress. A separately hosted poller adds the hosting account and its deployment credentials. There is no honest universal count without choosing that host.
The glue is specific: persist the pending hostname, schedule status checks, back off, deduplicate completion handling, and attach results to the publication's change record. An existing investment in those controls can justify keeping that stack. For a team already operating AWS or Google Cloud DNS tooling, preserving established access controls and change review can likewise outweigh consolidating API access. Credential consolidation should not decide where customer authority lives.
Can we just use www, or roll back immediately?
Using only www narrows the record contract, but it leaves the bare domain outside the promised entry points. A publication that distributes example.com in print, feeds, or campaign material should explicitly decide what readers get there. Publishing both apex and www addresses that requirement. A DNS record alone is not a complete redirect design, so define the intended application behavior separately.
Immediate rollback is a reasonable operational request, but it needs a precise meaning. You can decide promptly to restore the previous records. You cannot infer universal reader arrival from the write acknowledgment. If a release requires both names to reach the new destination before the old one is retired, make that a release condition and collect evidence for both names.
Document the address. Preserve the previous values. Keep the observation trail attached to the change. Those modest choices make the propagation-delay versus cutover-speed decision visible to the people responsible for the newsroom window.
References
RFC 1034 supplies the CNAME coexistence rule. The provider references describe the competing service boundaries and should be checked against the intended customer-zone arrangement before implementation.
Top comments (0)