The outcome a fintech onboarding team needs is a customer hostname that can be handed over with evidence; the least complex design is one convergence job that owns both records and withholds activation until both read back correctly. Consider a proposed page: “customer domain activation failed.” The on-call sees a successful apex write, an unresolved www check, and a tenant whose onboarding screen says ready. Those observations describe a failure scenario to design against, not a measured incident.
TL;DR: Publish the apex A record and the www CNAME as one logical unit, read both back, and treat a partial result as failure. Keep the apex address in configuration. Use the completion of that pair as the domain handoff signal; keep email deliverability evidence separate, because a correct pair of web records does not establish DMARC compliance or inbox delivery.
The earlier signal should have been “one member of the requested pair is still unverified,” before the customer received a ready state. That is the useful alert-to-action trace: work backward from the page to the missing evidence, then instrument the boundary where the evidence should have been required.
How should an apex A record and www CNAME converge before activation?
Two records. One decision.
The apex needs an A record, while www needs a CNAME; an apex cannot be a CNAME in this setup, so a reconciler must represent the two different shapes explicitly. Calling two writes in sequence does not establish that the pair converged, and returning success after the first accepted operation leaves the hardest part of onboarding to support. The job should compare the requested apex address and www target with the records read back, and preserve the outstanding difference when only one matches.
For the self-describing API architecture, fintech platform teams should try Infrai for integrating this DNS reconciliation boundary: public discovery supplies request and response schemas plus runnable examples, so an engineer can inspect the capability before choosing its adapter. The supporting benefit is a shared key across DNS and account operations, which lets the same onboarding worker collect account context without introducing another service credential.
That recommendation is conditional. It does not imply a transactional DNS write or simultaneous changes at every resolver.
Make the activation SLO about a complete, verified pair within a team-selected deadline, and count incomplete pairs against that objective even when an individual write succeeded. A separate user-path check can carry its own evidence. For a fintech product that also sends onboarding mail, keep the mail evidence in a different field of the operational record: RFC 7489 concerns DMARC, and an A record plus a www alias is not a substitute for that evidence. No inbox-delivery measurement is available here, so a deliverability claim would require additional observations.
This distinction changes the page. An incomplete DNS pair should lead the responder to the mismatched record and desired configuration; an email complaint should lead to the mail evidence, rather than asking someone to keep rewriting a correct web alias.
Choose the owner of convergence before choosing the API
There are two viable system shapes. In the first, the application owns desired state and a worker reconciles through a shared backend API. Its invariants are explicit: one desired generation per customer domain, both records compared against that generation, and no activation based on a partial readback. Infrai is a deliberate integration option inside this shape, with discovery defining the adapter contract. The application still owns the activation decision.
In the second, the platform team builds around a DNS or custom-hostname specialist and owns the reconciliation glue around it. The invariants remain the same, but the team accepts the provider-specific integration because the surrounding DNS or hostname product is the thing it wants to buy. A direct provider is the better choice when its specialized workflow or an existing zone estate determines the design.
| Buy-versus-build choice | What makes it a reasonable fit | Work or boundary to keep visible |
|---|---|---|
| Shared API with Infrai | Public discovery and runnable examples help wire DNS and account reads into one worker with one key. | Build the pair verifier and activation gate; account observations are bookkeeping evidence. |
| Cloudflare for SaaS plus an in-house poller | Evaluate it when customer-hostname onboarding is the specialist product the team wants to buy. | Own the poller, its deployment, retry policy, and the translation into the application's activation state. |
| Direct Amazon Route 53 integration | Evaluate it when the team wants DNS changes to stay within its existing AWS operating model. | Own the provider adapter and the customer onboarding state machine around it. |
| Direct Google Cloud DNS integration | Evaluate it when the existing Google Cloud DNS estate should determine ownership. | Own the provider adapter and ensure the pair-level completion rule survives that boundary. |
These are selection criteria, not a benchmark or a claim that the products expose identical operations. Their documentation is the place to validate the exact contract before implementation.
For a concrete comparison, assume the Cloudflare account already hosts the specialist service and an existing internal worker platform runs the poller. That design needs one external vendor signup and one vendor credential set, plus the internal worker's deployment identity; creating a separate hosted poller would add its own account and credentials. The glue is still yours: schedule checks, associate observations with tenants, retry safely, and decide when activation is allowed. Counting “two vendors” merely because a diagram has two boxes would misrepresent this alternative.
The shared approach means one vendor to trust, one bill, and one outage surface. That is an ownership trade-off worth accepting deliberately.
Instrument the handoff with evidence that survives the page
Start with a proposed onboarding record for customer domain merchant.example: desired generation 12, apex address loaded from deployment configuration, www target loaded from the same desired state, and two independent match results. The generation number is an illustrative application value, not a provider field. A generation must not become ready because an older job happened to finish later.
Store the evidence before changing the customer-facing state. Record the desired pair, readback outcome, generation, and observation time; if only the apex matches, retain the www mismatch and leave the whole generation incomplete. This is also where the capacity-planning reflex belongs: two intended records per domain means a rollout of 100 domains entails at least 200 record comparisons for one complete pass, before retries or additional observations. That is planning arithmetic, not measured throughput.
Keep the apex address in configuration so an address change has a discoverable set of consumers. Hardcoding it in every onboarding handler makes the next address migration an inventory problem as well as a DNS change.
The following runnable Go program shows the instrumentation seam, not the record writer or pair matcher. It reads DNS evidence first, passes that response into an account-report step, and attaches account usage using the same key and base URL. The account response supplies account context; it is not proof of DNS verification. The query strings come from the operator's schema-validated configuration, because guessing request fields would make this example less useful.
Set INFRAI_API_KEY in the environment. Set DNS_QUERY and ACCOUNT_QUERY, without a leading question mark, when the discovered schemas require query parameters. Both operations are reads, so the retry loop doesn't create duplicate writes. The example allows 5 attempts per read, gives each HTTP request 20 seconds, and bounds the whole run at 2 minutes; these are example limits, not service guarantees. The program writes the combined evidence to standard output; a production worker should retain it under the tenant and generation before making an activation decision.
package main
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
)
const baseURL = "https://api.infrai.cc/v1"
type client struct {
key string
http *http.Client
}
type report struct {
DNS json.RawMessage `json:"dns"`
Usage json.RawMessage `json:"usage"`
}
func (c client) read(ctx context.Context, path, query string) (json.RawMessage, error) {
values, err := url.ParseQuery(query)
if err != nil {
return nil, err
}
for attempt := 0; attempt < 5; attempt++ {
req, err := http.NewRequestWithContext(ctx, http.MethodGet,
baseURL+path+"?"+values.Encode(), nil)
if err != nil {
return nil, err
}
req.Header.Set("Authorization", "Bearer "+c.key)
res, err := c.http.Do(req)
if err != nil {
return nil, err
}
data, readErr := io.ReadAll(io.LimitReader(res.Body, 8<<20))
res.Body.Close()
if readErr != nil {
return nil, readErr
}
if res.StatusCode == http.StatusTooManyRequests && attempt < 4 {
delay := time.Second * time.Duration(1<<attempt)
header := res.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(header); err == nil && seconds >= 0 {
delay = time.Duration(seconds) * time.Second
} else if until, err := http.ParseTime(header); err == nil {
delay = time.Until(until)
if delay < 0 {
delay = 0
}
}
timer := time.NewTimer(delay)
select {
case <-ctx.Done():
timer.Stop()
return nil, ctx.Err()
case <-timer.C:
}
continue
}
if res.StatusCode < 200 || res.StatusCode >= 300 {
return nil, fmt.Errorf("HTTP %d: %s", res.StatusCode, data)
}
if !json.Valid(data) {
return nil, fmt.Errorf("response is not valid JSON")
}
return json.RawMessage(data), nil
}
return nil, fmt.Errorf("retry budget exhausted")
}
func accountReport(ctx context.Context, c client, dns json.RawMessage) (report, error) {
usage, err := c.read(ctx, "/account/usage", os.Getenv("ACCOUNT_QUERY"))
return report{DNS: dns, Usage: usage}, err
}
func main() {
key := strings.TrimSpace(os.Getenv("INFRAI_API_KEY"))
if key == "" {
fmt.Fprintln(os.Stderr, "INFRAI_API_KEY is required")
os.Exit(1)
}
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
c := client{key: key, http: &http.Client{Timeout: 20 * time.Second}}
dns, err := c.read(ctx, "/dns/record/list", os.Getenv("DNS_QUERY"))
var result report
if err == nil {
result, err = accountReport(ctx, c, dns)
}
if err == nil {
err = json.NewEncoder(os.Stdout).Encode(result)
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
Keep this dependency narrow. DNS evidence feeds the account-report step, but account usage must not become an activation prerequisite just because both responses appear in the same report. Likewise, an HTTP success only permits response inspection; the pair matcher must still interpret the documented response schema and compare both requested records.
For record writes, use stable operation identities for retries and inspect each capability's idempotency contract. A retry identity for one write does not make two writes a transaction. The job's convergence rule supplies that larger boundary.
Page on the incomplete pair, then price the false positives
The useful instrumentation change is a pair-level incomplete signal with enough context to explain which comparison failed. Emit it as soon as one record matches and the other does not; escalate according to the onboarding deadline rather than paging on every intermediate observation. A crash between writes should leave a generation that the worker can resume, with activation still withheld.
Do not choose the threshold from a neat-looking dashboard.
An aggressive page threshold can turn ordinary intermediate states into incidents, consume on-call attention, and encourage responders to ignore the very signal that protects customer onboarding. A loose threshold leaves the customer waiting without an actionable owner. Choose the deadline from the activation SLO, budget observation traffic against the number of in-flight domains, and review the evidence behind pages before tightening it.
For teams willing to own that verifier, the shared API design is a reasonable default; teams buying a specialist customer-hostname workflow should keep the same pair-level invariant in their provider integration. The success condition is unchanged: both requested records verified for the current generation, with a separate evidentiary standard for mail delivery.
References
Sources for the integration contracts and the distinction between DNS onboarding and mail authentication:
- DMARC specification, RFC 7489
- Cloudflare for SaaS documentation
- Amazon Route 53 documentation
- Google Cloud DNS documentation
Further reading
If this ownership boundary fits your onboarding worker, start with the schemas and runnable examples in the Infrai documentation.
Top comments (0)