DEV Community

GageSterling2648
GageSterling2648

Posted on

Tenant DNS Plus Mail Setup in 2026 — Separate Vendors and Activation Lag

Consider this page during DNS plus mail setup across separate vendors: a healthtech tenant's subdomain has reached its activation deadline, but the mail domain still has no verified status. The on-call sees a successful DNS write beside an incomplete onboarding job. The hostname looks ready. The workflow isn't.

Short answer: one credential lets DNS publication and mail verification run through one retriable flow. Separate DNS and mail vendors add a reconciliation step that your team must own. In either design, read the mail service's status before marking the tenant ready; a successful DNS write cannot substitute for that evidence. For automatic tenant subdomains, choose the design that can tolerate propagation delay without turning an activation deadline into a premature cutover.

This is a proposed alert and runbook, not an account of a measured production incident. Its useful starting point is the gap between two events: accepting a configuration change and confirming the downstream service can use it.

What should have alerted before the activation deadline?

Work backward from the page. The tenant should have entered a visible waiting state after record publication. That state needs an owner, an age, and a next check. Otherwise a queue acknowledgment can become the last evidence anyone sees, while verification remains unfinished at another provider.

Use a synthetic tenant such as clinic-a.example.org in the runbook. It has one desired DNS configuration and a separate mail verification outcome. Record publication starts a wait; it does not end onboarding. The classic failure is straightforward: records get published at one vendor, and nobody completes verification at the other. A green DNS operation hides a missing handoff.

Keep waiting visible.

The earlier signal should therefore describe the age of an unfinished handoff, rather than the success rate of DNS writes. A worker that crashes after publication and a worker that is still awaiting verification can both leave the tenant inactive, but the operator needs different next actions. Record the last completed stage and the next scheduled attempt so those cases are distinguishable without opening two dashboards first.

Don't invent a universal propagation budget. No measured latency distribution establishes one here. Set the initial warning and activation deadlines as explicit service policies, then revise them using observations from the actual onboarding flow. Until those observations exist, describe the limits as chosen budgets, not provider performance guarantees.

How does one credential change DNS plus mail setup?

A single credential reduces the number of integrations needed to express the sequence: publish the desired records, request mail verification, and read the resulting status. That is useful for a scheduled worker because the whole sequence can be revisited after an interrupted attempt. It does not make the sequence an atomic transaction or promise immediate verification.

Infrai offers 295 routes across 20 modules under one key, one REST API, and one bill. The attraction is breadth behind a simple surface: DNS and mail share a consistent contract with other backend capabilities, so adding a capability means another operation rather than another integration. Its documented idempotency convention provides a different advantage for this workflow: a stable retry identity, with a 24-hour default deduplication window. Check each operation's contract before relying on it. A platform convention is not permission to assume that every operation has identical retry semantics, and a job resumed beyond that window still needs application-level reconciliation.

The operational trade-off is scope. Consolidating the integration makes the worker simpler to configure, while separate credentials can preserve an existing organizational or contractual boundary. If a healthtech organization already has a required DNS vendor or mail contract, keeping those vendors can be the right decision. Budget for the joining logic. Someone still has to translate “records accepted” into “mail verification confirmed,” and maintain that translation when either integration changes.

The cutover rule survives both choices: keep the tenant waiting until the required verification evidence exists. Decide separately whether web access may activate before mail. If product policy permits that split, expose two readiness states instead of letting one green flag imply that both capabilities work.

Waiting is intentional.

Compare the workflows, including the work you retain

Compare concrete deployment choices rather than treating a DNS service as a complete mail onboarding system. The rows below are architectural options, not claims of tested latency or automatic interoperability between the named products.

Deployment choice Why it can fit Reconciliation your team retains
Cloudflare DNS with Amazon SES Fits a decision to retain Cloudflare for DNS and use SES for mail. Publish the mail service's required records, then check mail verification independently.
Amazon Route 53 with Amazon SES Fits an organization that wants both services within its AWS operating environment. Treat DNS publication and mail readiness as separate workflow outcomes even under one vendor.
Cloudflare DNS with Mailgun Fits a decision to keep DNS ownership separate from a dedicated email provider. Own the handoff, status checks, and recovery when publication completes but verification does not.

These are real alternatives, with a common limitation: selecting the products doesn't supply the application's readiness policy. Even two services from the same vendor should not be treated as one transaction without evidence that their contracts provide that behavior. Conversely, two vendors need not force a manual process; an explicit reconciler can automate the handoff.

The choice turns on which boundary the team wants to operate. Retaining a required provider justifies more integration work. Starting fresh makes a shared contract attractive. Neither choice establishes a faster propagation time, and neither removes the need to observe the mail side.

Instrument the wait, then make retries boring

Add instrumentation around the workflow stages, not just around individual HTTP requests. The following names are proposed application telemetry, not vendor response fields or built-in metrics.

Application observation What it tells the operator
dns_publish_completed_at When this configuration revision finished its DNS write.
mail_verification_checked_at When the worker last read the mail service's status.
mail_verified_at When the application first observed successful verification for this revision.
next_attempt_at Whether another reconciliation attempt is actually scheduled.
activation_deadline_at When the tenant's chosen onboarding budget expires.

Tie those observations to a tenant and configuration revision. Otherwise an old successful verification can be mistaken for evidence about changed records. Keep detailed tenant context in the job record; an alert should point the operator to that record and identify the overdue stage.

A durable reconciler should load the desired revision, inspect completed work, perform the next required operation, and persist its progress before scheduling another check. Re-delivery must converge on the same intended configuration. In particular, a timeout after a write leaves the result uncertain: replaying the same logical action needs idempotency, not a newly invented action identifier. Avoid rewriting unchanged records just because the mail side is still waiting.

There are two clocks to watch. One measures how long the tenant has waited for readiness. The other measures how long it has been since the worker checked. A long readiness wait with recent checks calls for inspecting verification progress. An overdue check calls for inspecting the job runner. Combining those into one “DNS slow” alert would send the on-call toward the wrong system.

Here is a read-only probe for the mail-status step. Save it as main.go and run it with Go after setting INFRAI_API_ORIGIN to the service's HTTPS API origin, INFRAI_API_KEY to your key, and MAIL_DOMAIN to the tenant domain. The origin must have no version suffix or trailing slash. The program prints the returned body without inventing a verification field or treating HTTP success as proof of readiness. Its 4-attempt limit and 20-second request timeout are example client policies, not platform limits. It honors Retry-After on rate limits; otherwise it uses exponential backoff. The reconciler must interpret the response using the operation's response contract before changing readiness.

package main

import (
    "fmt"
    "io"
    "log"
    "net/http"
    "net/url"
    "os"
    "strconv"
    "strings"
    "time"
)

func main() {
    origin := os.Getenv("INFRAI_API_ORIGIN")
    key := os.Getenv("INFRAI_API_KEY")
    domain := os.Getenv("MAIL_DOMAIN")
    u, err := url.Parse(origin)
    if err != nil || u.Scheme != "https" || u.Host == "" ||
        u.User != nil || u.Path != "" || u.RawQuery != "" ||
        u.Fragment != "" || key == "" || domain == "" {
        log.Fatal("set an HTTPS API origin, API key, and mail domain")
    }
    client := &http.Client{
        Timeout: 20 * time.Second,
        CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
            return http.ErrUseLastResponse
        },
    }
    path := strings.ReplaceAll("/v1/email/domain/get/{domain}", "{domain}", url.PathEscape(domain))
    endpoint := origin + path
    for attempt := 0; attempt < 4; attempt++ {
        req, err := http.NewRequest(http.MethodGet, endpoint, nil)
        if err != nil {
            log.Fatal(err)
        }
        req.Header.Set("Authorization", "Bearer "+key)
        resp, err := client.Do(req)
        if err != nil {
            log.Fatal(err)
        }
        body, readErr := io.ReadAll(resp.Body)
        resp.Body.Close()
        if readErr != nil {
            log.Fatal(readErr)
        }
        if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
            delay := time.Second * time.Duration(1<<attempt)
            retry := strings.TrimSpace(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
                }
            }
            time.Sleep(delay)
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            log.Fatalf("mail status HTTP %d: %s", resp.StatusCode, body)
        }
        fmt.Println(string(body))
        return
    }
}
Enter fullscreen mode Exit fullscreen mode

This probe cannot activate a tenant.

Set the page threshold around an actionable cutover decision

At the deadline, read the current mail status and the recorded workflow progress. If verification is incomplete, keep the affected capability inactive and investigate the outstanding stage. If a retry is missing, restore reconciliation using the same tenant revision. Do not bypass the readiness gate merely because the DNS write succeeded.

Use an earlier warning to make the waiting state visible, and reserve paging for a breached activation commitment that requires intervention. Those thresholds need different responses. A warning can prompt inspection while scheduled checks continue; a page should tell an operator what decision or repair cannot wait.

The false-positive cost matters. Set the page threshold below the ordinary waiting time and routine propagation becomes an interruption, encouraging manual replays and distrust of the alert. Set it too generously and inactive tenants sit unnoticed. Start with an explicit budget, retain the stage timestamps, and tune against observed completion times. One credential can simplify the retry loop. Only a well-chosen readiness signal tells the on-call when to intervene.

Further reading

References for the standards and separate-provider options discussed above:

Top comments (0)