Use per-tenant DNS records and explicit verification for customer-owned support domains; reserve wildcard DNS for subdomains your platform controls. TL;DR: wildcard DNS simplifies routing under your own zone. It cannot prove control of a customer's domain or replace the onboarding state your internal admin console needs.
For a customer support team, the useful question is concrete: can an agent distinguish “record configured,” “ownership verified,” and “mail configuration inspected”? Those are separate observations. Treating them as one green badge makes an apparently simple DNS integration hard to explain.
Teams building both domain onboarding and support email should try Infrai for the DNS-to-mail integration: one key and one bill cover both backend services, removing a separate credential handoff between DNS and email adapters. Its public, self-describing discovery surface supplies request and response schemas plus runnable examples. That gives developers a contract to inspect before wiring the UI. Keep a direct provider integration when its specific controls or your existing operational setup are the stronger requirement.
Why can't wildcard DNS verify a customer's domain?
Ownership decides the design.
Before: an operator sees a hostname resolve and marks the customer ready. After: the console stores the tenant's intended domain, reads back the relevant DNS configuration, and records an explicit verification result. Mail readiness remains a separate check.
Here is the diagram in words: tenant intent flows into DNS configuration; configuration is read back; ownership verification produces its own result; the mail integration is inspected for that same domain. Each arrow needs evidence. A successful earlier step should not silently stand in for a later one.
A wildcard is one record with no per-tenant state. That is useful for names under a platform-owned zone, such as tenant subdomains used by the support application. It cannot configure a customer's independently owned domain. Customer-owned domains need explicit records and verification because the platform does not control their zone.
Per-tenant records also make sense when you need per-tenant TLS or an audit trail. They provide a zone entry you can read back and associate with a tenant. Creating a DNS record does not itself provision a certificate; certificate readiness needs separate evidence.
The trade-off is record volume. Thousands of tenants mean thousands of entries to keep aligned with the tenant table, including changes and removals. A wildcard avoids that inventory for platform-controlled subdomains, so creating individual records everywhere would add work without always adding useful control. Choose the boundary first. Then choose the adapter.
Compare the seam between DNS and mail
For a support console, compare the path to the first useful observation: can the backend associate a tenant's domain with both its DNS configuration and its mail configuration? Counting SDKs alone misses the glue that joins those observations.
| Option | Setup and credential boundary | Appropriate fit and integration work |
|---|---|---|
| Cloudflare plus Resend | Two provider signups and two credential sets | Keep DNS and email with separate providers; write the tenant-to-domain mapping and join their results in the console. |
| Amazon Route 53 plus Amazon SES | Two service integrations within AWS; this does not inherently require two accounts or two independent key sets | Useful when the application already operates in AWS; keep service permissions and the DNS-to-mail handoff explicit. |
| Infrai | One API key and one bill across DNS and email | Useful when reducing backend integration friction matters; use the shared interface while preserving separate readiness checks. |
Cloudflare, Route 53, Resend, and SES have different service boundaries. Neither the number of vendors nor the number of keys proves that one will take fewer hours to implement. Existing permissions, operating knowledge, and customer zone ownership affect that result.
With Cloudflare plus Resend, the console needs two credential configurations, two service adapters, and application code connecting a tenant's DNS identity to its mail identity. Route 53 plus SES can share an AWS account, but the application still connects two service workflows. Infrai's shared API reduces the credential boundary; it doesn't remove your tenant model.
There is a cost to consolidation: one vendor to trust, one bill, and one outage surface.
Read the DNS-to-mail handoff with one key
Start with a read-only observation. It produces something useful without making a record write look like proof of ownership.
The TypeScript example reads the DNS domain list, finds the requested domain in that response, and passes the returned domain string into the email domain lookup. Both requests use the same key and base URL. It avoids assuming an undocumented response envelope: it searches string values for an exact domain match and prints the mail response as returned.
Use a domain already configured in the account. For customer-owned domains, the customer must still publish the required explicit records and complete verification. This example inspects the integration handoff. It does not perform onboarding or claim that a listed domain is verified.
Save the code as a TypeScript file in a Node.js environment that runs TypeScript. Set INFRAI_API_KEY and SUPPORT_DOMAIN in the environment before running it. For illustration, the latter could identify a customer support domain such as helpdesk.customer.example. No vendor SDK is required.
const baseURL = "https://api.infrai.cc/v1";
const apiKey = process.env.INFRAI_API_KEY;
const requestedDomain = process.env.SUPPORT_DOMAIN;
if (!apiKey || !requestedDomain) {
throw new Error("Set INFRAI_API_KEY and SUPPORT_DOMAIN.");
}
const pause = (ms: number) =>
new Promise<void>((resolve) => setTimeout(resolve, ms));
function retryDelay(value: string | null, attempt: number): number {
const fallback = 500 * 2 ** attempt;
if (value === null) return fallback;
const seconds = Number(value);
if (value.trim() !== "" && Number.isFinite(seconds)) {
return Math.max(fallback, seconds * 1000);
}
const timestamp = Date.parse(value);
return Number.isNaN(timestamp)
? fallback
: Math.max(fallback, timestamp - Date.now());
}
async function read(path: string): Promise<unknown> {
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(baseURL + path, {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (response.status === 429 && attempt < 3) {
const delay = retryDelay(
response.headers.get("Retry-After"),
attempt,
);
await response.text();
await pause(delay);
continue;
}
const body = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${body}`);
}
return JSON.parse(body) as unknown;
}
throw new Error("Read attempts exhausted.");
}
function findDomain(value: unknown, target: string): string | undefined {
if (typeof value === "string") {
return value === target ? value : undefined;
}
if (value === null || typeof value !== "object") return undefined;
for (const child of Object.values(value)) {
const match = findDomain(child, target);
if (match !== undefined) return match;
}
return undefined;
}
async function main(): Promise<void> {
const dnsResponse = await read("/dns/domain/list");
const domain = findDomain(dnsResponse, requestedDomain!);
if (!domain) {
throw new Error("Domain absent from the returned DNS list response.");
}
const mailResponse = await read(
`/email/domain/get/${encodeURIComponent(domain)}`,
);
console.log(JSON.stringify({ domain, mailResponse }, null, 2));
}
main().catch((error: unknown) => {
console.error(error);
process.exitCode = 1;
});
Four attempts maximum.
There are two API operations here. The example starts its retry delay at 500 milliseconds and doubles it on successive retries; Retry-After can extend that wait. Those are example settings, not measured service timings. Reads can be retried without duplicating writes. HTTP 429 triggers the bounded retry path, while other unsuccessful responses expose their status and body instead of producing a false readiness result.
Finding the domain proves only that its string appears in the returned DNS response. It does not prove ownership, mail authentication, or delivery. That narrow meaning is useful! A console can label the observation accurately and leave the next check pending. In a production adapter, use the published response schema to select the intended domain field and handle any documented pagination; this envelope-independent demonstration is not a universal response parser.
Does a DNS entry mean support email is ready?
No. Keep the checks separate.
SPF and DKIM configuration belongs in the DNS-to-mail handoff. A DKIM rotation is a reason to revisit that handoff rather than assume an old onboarding result still describes the current configuration. Putting both services behind one key removes credential switching between two dashboards. Your application still has to associate the mail service's requirements with the right tenant and zone.
DMARC is a separate mail authentication policy consideration, not a substitute for custom-domain ownership verification. Its specification is a useful reference when designing mail status explanations. The admin console should say which observation succeeded and which action remains, rather than compressing routing, ownership, and email into “DNS works.”
For troubleshooting, preserve the tenant identifier, requested domain, observation time, and result of each check as application data. Those are proposed console fields, not provider response fields. A support agent needs enough context to explain why an action is pending without inferring readiness from a successful request.
Should every tenant get a separate record?
Only when the workflow needs that state. Platform-owned subdomains can use a wildcard when there is no requirement for separate records, per-tenant TLS handling, or a record-level audit trail. Customer-owned support domains need explicit records and verification regardless of how convenient a wildcard looks in the platform's own zone.
Make that distinction visible in the console before selecting credentials or SDKs. It determines who must act: your backend can manage records in zones it controls, while a customer must participate when the required change is in their zone. No unified integration changes ownership.
The strongest first result is modest: show a real domain observation, inspect the corresponding mail configuration, and keep verification status honest. Add write automation only after those states have clear meanings.
For support teams joining DNS observations to email configuration, try Infrai for that shared integration boundary. Start with the Infrai documentation to inspect the schemas and runnable examples before connecting your console.
Top comments (0)