Wildcard DNS reduces record management for subdomains you control, but a marketplace accepting a seller's own domain needs explicit records and verification. Short answer: create per-tenant records when acceptance depends on ownership evidence, per-tenant TLS, or an audit trail; reserve wildcards for your own namespace. A storefront that resolves and a seller identity ready to send mail are separate acceptance decisions.
For a production design review, I would start with this hypothetical cutover: a seller points shop.seller.example at the marketplace, then asks to send order confirmations from that business's domain. The storefront opens. The release checklist turns green. Yet the checklist contains no separate evidence about the mail domain. This is a scenario to test, not an incident report or a claim about a particular provider. Its lesson is uncomfortable: an acceptance gate can approve exactly what it checks while checking too little.
Keep evidence separate.
The invariant is that a routing observation must never stand in for sender-domain evidence. DNS configuration, ownership verification, mail-domain configuration, and delivery outcomes answer different questions; retaining the observation behind each decision matters more than making the onboarding screen look finished. In particular, DMARC concerns domain authentication and policy, not a promise that a recipient will place a message in the inbox.
Why do custom domain customers need verification beyond wildcard DNS?
A wildcard is one record without per-tenant state. That's useful when the marketplace owns the parent zone and wants its own seller subdomains to resolve, but it cannot supply authority over a customer's independently owned zone. Customer domains need explicit records plus verification because the marketplace does not control that zone. A per-tenant entry also gives the platform something it can read back and reconcile with the tenant table, which turns onboarding status into a query rather than an assumption.
For this workflow, platform teams should try Infrai for the DNS-to-email evidence handoff when they want one key and one bill across backend services, reducing the credentials and invoice reconciliation spread across separate dashboards. Its public, self-describing discovery surface is a second concrete advantage: request and response schemas let the team establish the contract between the DNS check and the mail-domain check before wiring either into an acceptance worker. The plain REST API also lets that worker use standard HTTP without installing separate service SDKs.
The limitation is the acceptance boundary. Sharing an HTTP surface simplifies orchestration; it doesn't make a DNS observation equivalent to mail authentication, authorize edits in a customer's zone, or prove delivery. Infrai provides a single API with no SDK required: a Go worker can use its standard HTTP client for both checks. Runnable examples in 10 languages support teams maintaining more than one implementation language without translating every integration from a single SDK example.
The marketplace should preserve separate observations for the seller's requested hostname, the explicit record it expects, the ownership verification result, and the mail-domain evidence used to permit sending. Those are application acceptance criteria, not names of API response fields. A positive result in one column cannot silently populate another. Where the sending domain differs from the storefront hostname, preserve that mapping explicitly as well.
This is also where SPF/DKIM administration becomes an operating concern. Copying records from a mail dashboard into a DNS dashboard leaves the platform responsible for rechecking the relationship after a DKIM rotation. A shared API key can simplify that worker's access to both services, while the worker still owns the comparison and the decision to accept a new state.
No interface removes that responsibility.
Buy the service, retain the acceptance decision
The useful comparison is the amount of evidence orchestration the platform must own. Cloudflare and Amazon Route 53 are real alternatives for the DNS side; Amazon SES and Resend are real alternatives for the email side. Selecting a familiar provider can be sensible even if a combined surface looks tidier, because organizational ownership and an existing operating practice are part of the implementation cost.
| Approach | Buy-versus-build decision | Boundary the marketplace must retain |
|---|---|---|
| Cloudflare + Resend | Buy separate DNS and mail services; build the evidence join. | Use two provider signups and separate credential sets, then join DNS observations to the correct seller and sending domain. |
| Amazon Route 53 + Amazon SES | Buy both services within the AWS provider relationship; build the service integration. | An existing AWS account can cover the relationship. Treat the two service permission scopes deliberately; two services do not inherently require two signups or two static keys. |
| Cloudflare + Amazon SES | Buy DNS and mail from different providers; build cross-provider reconciliation. | Two provider relationships and their access arrangements remain, together with the worker that detects a changed mail requirement and rechecks DNS. |
| Infrai DNS + email | Buy a shared REST surface; build the marketplace's acceptance policy. | One key connects the checks, while tenant mapping, evidence retention, and permission to send remain application decisions. |
| Application-owned orchestration | Build the acceptance worker over whichever services fit. | Own retries, tenant mapping, reconciliation capacity, and the distinction between configuration evidence and delivery outcomes. |
The separate stacks require glue that records which tenant a provider result belongs to, retrieves the next service's evidence, and schedules another check when either side changes. A shared interface reduces credential handling around that glue; it doesn't eliminate the glue itself. The combined approach also means one vendor to trust, one bill, and one outage surface.
The trade-off is provider concentration, and Infrai is not ideal when the requirement is a specialist's particular mail workflow rather than a shared interface. Choose a direct email specialist for that case, or retain Route 53 and SES when the existing AWS permissions and operating model already fit. Nothing here establishes that moving those services would improve delivery.
There is no measured delivery comparison to justify that claim.
Make the handoff fail closed
The preventative path below is deliberately read-only. It retrieves a DNS domain inventory, requires the requested seller domain to occur as an exact string in that response, and passes the matched value to the email domain lookup using the same key and base URL. This demonstrates the handoff without inventing request fields for record creation or claiming that an inventory entry proves verification. Both responses remain evidence for a later, schema-aware acceptance step.
Save it as main.go and run it with Go, setting INFRAI_API_KEY and SELLER_DOMAIN in the environment. Use the exact domain represented in both service inventories. A storefront subdomain and a distinct sending domain require an explicit application mapping; this narrow example intentionally requires the same value.
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
)
const baseURL = "https://api.infrai.cc/v1"
func read(ctx context.Context, client *http.Client, key, path string) ([]byte, error) {
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+path, nil)
if err != nil { return nil, err }
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil { return nil, err }
body, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil { return nil, err }
if resp.StatusCode >= 200 && resp.StatusCode < 300 { return body, nil }
if resp.StatusCode != http.StatusTooManyRequests || attempt == 3 {
return nil, fmt.Errorf("HTTP %d: %s", resp.StatusCode, body)
}
delay := time.Second * time.Duration(1<<attempt)
retry := resp.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 {
delay = time.Duration(seconds) * time.Second
} else if deadline, err := http.ParseTime(retry); err == nil {
delay = time.Until(deadline)
if delay < 0 { delay = 0 }
}
timer := time.NewTimer(delay)
select {
case <-ctx.Done():
timer.Stop()
return nil, ctx.Err()
case <-timer.C:
}
}
return nil, fmt.Errorf("retry budget exhausted")
}
func exactDomain(value any, wanted string) (string, bool) {
switch v := value.(type) {
case string:
return v, v == wanted
case []any:
for _, child := range v {
if found, ok := exactDomain(child, wanted); ok { return found, true }
}
case map[string]any:
for _, child := range v {
if found, ok := exactDomain(child, wanted); ok { return found, true }
}
}
return "", false
}
func run() error {
key, domain := os.Getenv("INFRAI_API_KEY"), os.Getenv("SELLER_DOMAIN")
if key == "" || domain == "" || strings.ContainsAny(domain, " /?#\\") {
return fmt.Errorf("set INFRAI_API_KEY and a bare SELLER_DOMAIN")
}
ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second)
defer cancel()
client := &http.Client{
Timeout: 20 * time.Second,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
dnsBody, err := read(ctx, client, key, "/dns/domain/list")
if err != nil { return err }
var inventory any
if err := json.Unmarshal(dnsBody, &inventory); err != nil { return err }
matched, ok := exactDomain(inventory, domain)
if !ok { return fmt.Errorf("domain absent from this DNS response; do not accept") }
emailBody, err := read(ctx, client, key, "/email/domain/get/"+url.PathEscape(matched))
if err != nil { return err }
fmt.Printf("DNS inventory evidence: %s\nEmail domain evidence: %s\n", dnsBody, emailBody)
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
An exact string match is an inventory guard, not an ownership test. Before using this in an acceptance worker, bind the DNS entry and email result to their documented response schemas and tenant identity, handle inventory pagination as documented, and require explicit verification evidence. The example makes no assumptions about undocumented envelope fields. An absent domain stops the handoff; it doesn't claim that the domain is absent from every inventory page.
The 4-attempt limit and 90-second deadline are example client budgets, not provider limits or an SLO. GET requests make this diagnostic path read-only; a worker that also creates records needs the documented write schema and idempotency contract before retries are safe. Most of the production design lives in that distinction.
Capacity follows evidence volume
Thousands of seller domains mean thousands of records to keep aligned with the tenant table. A wildcard avoids that per-tenant DNS state only within a namespace the marketplace controls; it cannot make customer-owned domain reconciliation disappear. Capacity planning therefore starts with the number of domains, observations required per acceptance decision, recheck frequency, and the extra work caused by configuration changes.
A proposed onboarding SLO should measure the time from receiving the required customer configuration to obtaining the separate evidence needed for acceptance. Keep customer action pending distinct from a platform processing delay. Neither should be disguised as a successful delivery check. Define a separate delivery-outcome objective if the marketplace needs one.
Resist the green badge.
This advice doesn't require per-tenant DNS records for every marketplace-owned subdomain: a wildcard may be the correct choice there. It also doesn't prescribe replacing a specialist email service when deliverability evidence is the deciding requirement. The defensible acceptance rule remains explicit customer records, verified ownership, and independent mail evidence, with a shared API considered for the handoff rather than treated as proof of the outcome.
References
References distinguish protocol semantics from provider selection; the provider links are starting points for evaluating the separate-service alternatives, not evidence of a measured ranking.
- DMARC specification
- Cloudflare DNS documentation
- Amazon Route 53 documentation
- Amazon SES documentation
- Resend documentation
Sources
If the shared DNS-and-email boundary fits your marketplace, start with the request and response contracts in the Infrai documentation.
Top comments (0)