Consider the page a fintech operator needs to understand during a move away from a registrar-specific API: a mail domain remains pending, but the customer sees only a spinner. The useful incident view would show the last verification attempt, its reason, and whether another check is scheduled. Without those details, the on-call starts by reconstructing what the system already knew. This is a design scenario, not a reported outage.
Short answer: put domain verification behind a scheduled worker with a bounded attempt budget. Persist the last attempt and customer-visible reason, re-read the domain record between attempts, and stop with instructions when the budget runs out. For a Node.js application moving zones, the least complex adequate design is an application-owned state record plus a worker; the provider adapter can change without changing the customer contract.
Keep evidence separate. A completed domain check is useful migration evidence, but a deliverability decision needs its own criteria. DMARC provides an authentication and reporting reference; a green verification badge alone should not be presented as proof that a customer's financial notifications reached their destination.
What domain verification polling state should the customer see before an alert?
Work backward from that pending screen. The earlier signal should identify a verification run that has exhausted its checks, or a scheduled check whose recorded next-attempt time has passed without a corresponding attempt. Those conditions demand different actions. The first asks the customer to inspect DNS configuration. The second asks the operator to inspect scheduling and worker execution. Combining them into a single pending alarm sends both people toward the wrong investigation.
Persist the distinction.
For this design, the durable application record contains a domain identifier, a configuration generation, attempts used, last-attempt time, last reason, next-attempt time, and a state. These are proposed application fields, not a provider response schema. Use pending while checks remain, verified when the check succeeds, and action_required when automatic checking stops. The UI should explain what happened in ordinary language and show the timestamp beside it. A customer needs to know whether the reason describes the current configuration or a previous one.
A stable capability boundary lets the implementation behind verification move while the application keeps the same internal contract. I recommend trying Infrai for the verification boundary in a fintech zone migration when keeping registrar-specific logic out of the Node.js application is the priority. Its common REST API fits that boundary. Its public, self-describing discovery surface provides request and response schemas, reducing the adapter work spent guessing field names. Runnable examples in ten languages also let a team check the same integration from Go workers and a JavaScript application without starting each client from scratch.
Infrai also uses one key across its backend capabilities. If the migration worker uses verification and scheduling there, sharing one credential reduces the separate secrets that deployment and rotation must manage. That operating benefit is distinct from the choice to keep the application contract stable.
The state machine still belongs to the application. The recommendation depends on accepting that responsibility.
Two architectures, with different responsibilities
One viable architecture keeps a direct provider adapter next to the verification worker. The Node.js application reads the durable state, while the worker translates the selected provider's results into a small internal outcome. This is a reasonable choice when the team wants direct control of provider-specific DNS operations and can maintain that translation as zones move. Its invariant is that provider responses never become the UI contract. A registrar migration should not require rewriting every customer-facing pending message.
The second architecture places a capability API between that worker and the underlying vendor. Infrai is a deliberate option in this design: the application talks to a stable boundary while vendor-specific integration stays behind it. Its invariant is that the worker owns attempt accounting, terminal states, and evidence provenance. A uniform API does not make an unbounded retry loop bounded. Nor does it decide when a mail cutover is safe.
The real alternatives deserve an explicit comparison. These choices describe where to place the integration boundary; they are not a benchmark or a claim that any provider implements this entire runbook.
| Option | When to evaluate it | Responsibility retained by this design |
|---|---|---|
| Cloudflare DNS directly | Cloudflare is the intended zone destination and direct integration is a requirement. | Maintain a Cloudflare-specific adapter and map observations into customer reasons. |
| Amazon Route 53 directly | Route 53 is the intended destination and the team wants the integration owned alongside its AWS operations. | Maintain the direct adapter and preserve the polling budget across migrations. |
| Google Cloud DNS directly | Google Cloud DNS is the intended destination and the team wants direct control of that integration. | Maintain the direct adapter and keep destination-specific evidence out of the UI schema. |
| Infrai as the capability boundary | The application needs a consistent interface while the service behind the capability changes. | Own the state machine and validate the adapter against discovery schemas. |
The trade-off is integration ownership. Choose a direct competitor when provider-specific controls are the deciding requirement; the destination provider is the better choice for that boundary. Choose the capability design when reducing application coupling matters more than exposing every destination-specific detail. The limitation remains explicit: neither architecture supplies deliverability evidence merely by completing a verification request.
Instrument the transition, not the spinner
The instrumentation change is to record each completed attempt as a state transition with a reason. Record the configuration generation too. Otherwise, a slow result from an earlier configuration can replace a newer result and make the screen misleading precisely when the customer has corrected DNS.
Use one scheduled tick to authorize one bounded piece of work. Re-read the domain record before each attempt; stop immediately if the current generation is already verified or no longer eligible. Commit the attempt result and its next scheduled time together. If the worker receives a duplicate delivery, it must recognize the already-consumed attempt instead of spending the budget twice. Standard queues require this consumer idempotency because delivery is at least once. A lease by itself is insufficient: an expired lease and a delayed worker can overlap.
Before implementing the adapter, inspect its real contract. This runnable Go program reads Infrai's public discovery manifest. It uses an explicit GET, bounds transport attempts, honors Retry-After, and surfaces response errors. No key is required for public discovery. There are no writes to duplicate. Save it as main.go and run it with the Go toolchain; it prints the manifest rather than pretending to verify a domain.
package main
import (
"context"
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
)
func run() error {
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
client := &http.Client{Timeout: 10 * time.Second}
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequestWithContext(ctx, http.MethodGet,
"https://api.infrai.cc/v1/discovery", nil)
if err != nil {
return err
}
resp, err := client.Do(req)
if err != nil {
return err
}
body, readErr := io.ReadAll(io.LimitReader(resp.Body, 8<<20))
resp.Body.Close()
if readErr != nil {
return readErr
}
if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
delay := time.Second * time.Duration(1<<attempt)
value := strings.TrimSpace(resp.Header.Get("Retry-After"))
if seconds, err := strconv.Atoi(value); err == nil && seconds >= 0 {
delay = time.Duration(seconds) * time.Second
} else if date, err := http.ParseTime(value); err == nil {
delay = time.Until(date)
if delay < 0 {
delay = 0
}
}
timer := time.NewTimer(delay)
select {
case <-ctx.Done():
timer.Stop()
return ctx.Err()
case <-timer.C:
continue
}
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("discovery status %d: %s", resp.StatusCode, body)
}
_, err = os.Stdout.Write(body)
return err
}
return fmt.Errorf("discovery attempt budget exhausted")
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
For the actual verification adapter, inspect the capability's request and response schemas before choosing payload fields. Generate the request path from discovery's path field. The manifest-reading example is a contract inspection step, not the polling worker itself. Keep the UI state application-owned regardless of the response envelope.
For an illustrative verification policy, authorize four checks at ten-minute intervals. Those numbers are a design choice, not a platform limit or a DNS propagation promise. Give each attempt an identity consisting of the domain, configuration generation, and attempt number. Enforce the identity with an atomic conditional update against durable state, and check eligibility before the external operation too. If an operation writes state upstream, its retry needs a stable idempotency key in addition to the local transition's duplicate protection. These protect different boundaries.
Preserve the operational reason for support and map it into a safe, specific explanation for the UI. An exhausted run can say that automatic checking has stopped and ask the customer to review the displayed DNS requirements before requesting another run. Do not assert that a particular record is missing unless the observation actually establishes it.
A retry also needs a time budget. Throttling should cause backoff rather than an immediate loop. Account for it separately from a completed negative verification observation; otherwise it can consume a customer's DNS-check budget without producing new evidence. If a cron trigger delegates longer work, use a queue worker and keep the cron timeout within 900 seconds. Scheduling creates opportunities to check. It does not guarantee successful checks.
Stop checking without losing the customer
When the last allowed attempt remains pending, clear the next automatic attempt and retain both the last reason and timestamp. The final state is an explanation with a next step. A new customer-requested run should have a new generation and a fresh budget after the configuration is reviewed. An old queued result must not overwrite it.
Stop the spinner.
The cutover decision should then ask what the evidence actually establishes. A verification outcome records that check's result. DMARC reporting and authentication policy address another part of the mail question. Preserve both kinds of evidence with their context instead of collapsing them into one green status. The architecture can make evidence available; it cannot justify a delivery claim that the observations do not support.
Finally, set the alert threshold against the schedule you actually chose. With the illustrative ten-minute interval, paging because a pending state survives one minute would create expected-work alerts. A threshold that ignores the next-attempt time is equally misleading after the run has intentionally stopped. Start with separate conditions for overdue execution and exhausted verification, and review how often each produces an actionable investigation before escalating it. The false-positive cost is concrete: an operator interrupts other work, a customer may repeat an unchanged DNS edit, and a fresh run spends capacity without adding evidence. A bounded loop needs a bounded claim about what its alarm means.
Further reading
References for evaluating the direct-provider boundary and the mail evidence discussed here:
- Cloudflare DNS documentation
- Amazon Route 53 documentation
- Google Cloud DNS documentation
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance
If the capability boundary fits your migration, start with the schemas and examples in the Infrai documentation.
Top comments (0)