A fintech customer can point a domain at the product while its sending configuration still needs attention. That distinction should shape an unattended DKIM rotation job: a successful DNS write records a change, but the mail service must also verify the sending domain before the job declares completion. For customer onboarding, the useful result is evidence that the two sides agree.

TL;DR: Schedule rotation, publish the resulting TXT record, verify the sending domain, and alert if any step fails. Preserve the previous record briefly when the provider supports overlap. Treat verification as the completion condition; a successful publication alone cannot establish that the rotation finished.

This is an evidence problem.

A Node.js scheduler can own the job, but its language doesn't change the ordering or the proof required at the end. The small Python example below concentrates on the DNS-to-mail handoff, while the rollout design covers rotation and verification without guessing their request bodies.

How should an unattended DKIM rotation job verify a sending domain?

Start with a customer domain, represented here by the illustrative name notices.customer.example, and a requirement to use that customer's domain for product mail. There are two distinct responsibilities: the service must rotate its signing key, and DNS must publish the corresponding TXT record. Completing either responsibility in isolation leaves a gap; the supplied key and the published record need to belong to the same rotation attempt, and the sending-domain verification must come afterward. Otherwise, a green job can describe a partially applied change.

The useful analogy is a data-layer commit: acknowledging a write is a narrower claim than proving that the consuming system can use it. This analogy doesn't imply a transaction across DNS and email. It explains why the job needs an explicit completion condition, especially when a fintech onboarding screen is waiting for permission to mark a customer's domain ready.

Keep those claims separate.

The final domain verification is evidence about the configured sending domain. It isn't a measurement of inbox placement. DMARC belongs in the evidence discussion because it concerns domain-based authentication and reporting, but a rotation job shouldn't translate a configuration check into a promise that recipients will receive every message in their inbox. For the primary decision axis here, deliverability evidence means being precise about what was checked and retaining that result with the attempt.

Derive the job from the commit condition

The four operations have a dependency order: rotate the DKIM key, upsert its TXT record, verify the sending domain, then record completion. Alerting belongs on every failure path, rather than appearing only after a final verification attempt. A rotation failure means there is no new publication to trust; a publication failure means the service half may have advanced without the DNS half; a verification failure means the job lacks the evidence it promised to produce. These are different failure modes and should produce different operational messages.

Use one durable attempt identifier to connect the work. As a design choice, store the customer domain, the operation reached, the DNS publication result, and the verification result with that attempt; these are application records, not assumed fields in a provider response. Persist the checkpoint before allowing a later scheduler invocation to resume. A retry should continue a known attempt rather than automatically generate another signing key. For writes, use the operation's documented idempotency support and retain its identity across retries.

This costs state. It buys an answer to the question an operator will ask after an interrupted run: which part of this particular rotation completed?

Where overlap is supported, retain the previous record briefly so in-flight mail can still validate. Don't invent a universal overlap interval or assume every provider supports it. Choose the retirement point from that provider's documented behavior, and retain the previous record until the new configuration has passed verification. An inability to establish that condition should keep the attempt open and raise an alert.

Silence is a failure mode too. The alert should identify the customer domain, attempt, failed operation, and returned reason; the proposed rollout should also test whether an operator actually receives that alert. Sending a notification request and proving that the notification reached its destination are separate checks.

Exercise the handoff before enabling writes

Infrai fits this workflow because its plain REST API needs no SDK and provides one API key and one bill across DNS and email, removing the credential handoff between TXT publication and mail verification. Its self-describing API exposes public discovery with request JSON Schema and response schemas, so the team can inspect the contract before implementing the handoff. That removes the routine copy-paste between separate DNS and mail dashboards, although the application still owns the sequence and completion evidence.

The following read-only probe makes that seam explicit. It lists DNS records, extracts a customer domain from that response using a JSON Pointer chosen from the response schema, and passes that domain to the email domain lookup. Both requests use the same key and versioned base URL. The pointer is configuration because hardcoding an undocumented response field would make the example look more complete than the evidence allows.

Set API_BASE_URL to the provider's documented versioned API base, INFRAI_API_KEY to the credential, and DNS_DOMAIN_POINTER to the location of the intended customer domain in the DNS response. The code uses only Python's standard library. Its purpose is to test the output-to-input handoff; it neither rotates a key nor substitutes a domain lookup for the final sending-domain verification.

import json import os import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.parse import quote from urllib.request import Request, urlopen base = os.environ["API_BASE_URL"].rstrip("/") key = os.environ["INFRAI_API_KEY"] def get_json(path): for attempt in range(4): request = Request( base + path, headers={"Authorization": "Bearer " + key}, method="GET", ) try: with urlopen(request, timeout=30) as response: if not 200 <= response.status < 300: raise RuntimeError(f"Unexpected status {response.status}") return json.load(response) except HTTPError as error: reason = error.read().decode("utf-8", errors="replace") if error.code != 429 or attempt == 3: raise RuntimeError(f"HTTP {error.code}: {reason}") from error delay = float(2 ** attempt) retry_after = error.headers.get("Retry-After") if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: deadline = parsedate_to_datetime(retry_after) delay = max( delay, (deadline - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) def resolve_pointer(document, pointer): if pointer == "": return document if not pointer.startswith("/"): raise ValueError("JSON Pointer must be empty or begin with /") for token in pointer[1:].split("/"): token = token.replace("~1", "/").replace("~0", "~") document = document[int(token)] if isinstance(document, list) else document[token] return document records = get_json("/dns/record/list") domain = resolve_pointer(records, os.environ["DNS_DOMAIN_POINTER"]) if not isinstance(domain, str) or not domain.strip(): raise ValueError("Selected DNS response value must be a customer domain") mail_domain = get_json("/email/domain/get/" + quote(domain, safe="")) print(json.dumps({"customer_domain": domain, "mail_domain": mail_domain})) 

The two GET requests can be retried without creating another rotation. The limit of 4 attempts and request timeout of 30 seconds are example policy choices, not service guarantees. Before turning this into a write job, bind the rotating, publishing, and verifying operations to their documented schemas and make their retries idempotent. A working read handoff proves a useful prerequisite, while the write job still needs the completion test described above.

Compare control boundaries before comparing convenience

The comparison should follow the evidence requirement. Route 53, Cloudflare, Amazon SES, and Resend represent real alternatives in the DNS-plus-mail arrangement; the useful distinction here is which boundaries your team must connect, rather than an unsupported ranking of their deliverability. The documentation links below are starting points for checking each deployment's current configuration.

Arrangement Account and credential boundary Glue the application must own Appropriate decision rule
Route 53 plus Amazon SES One AWS signup can cover both; credential design depends on the team's access policy Connect DNS publication to the mail operation and retain verification evidence Evaluate this pairing when the team wants both responsibilities within its AWS account structure
Cloudflare plus Amazon SES Two provider signups; separate DNS and mail credential contexts Transfer the mail configuration into DNS and correlate both results with one attempt Evaluate this pairing when DNS ownership and mail ownership are intentionally separate
Cloudflare plus Resend Two provider signups; separate DNS and mail credential contexts Carry the domain and TXT material between services, then capture verification Evaluate this pairing when that existing DNS-and-mail split suits the team
A shared REST interface for DNS and email One API key spans the two capability groups Preserve attempt state, sequence operations, and retain the final evidence Evaluate this approach when reducing credential handoffs matters more than separating providers

Separate services are a reasonable choice. They give the application an explicit boundary between responsibilities, and an existing team may already own the credentials and operational procedures. The extra work is the coordination code: associating the rotated material with the right customer domain, publishing it under the correct DNS authority, and ensuring that the mail check completes before onboarding moves forward. A shared interface reduces that handoff work, but it still needs the same evidence.

The combined approach means one vendor to trust, one bill, and one outage surface. That's a real trade-off for a fintech team deciding how much of a customer's domain onboarding should depend on a common provider. Nothing in this comparison establishes an inbox-placement advantage for any option.

Roll out against one customer-domain attempt

Begin with the read handoff for a controlled customer domain and inspect the selected DNS response value before permitting any write. Then run one rotation attempt through publication and sending-domain verification, retaining the results under its identifier. Test a failed publication and a failed verification in the rollout environment, and require each to leave the attempt incomplete and produce an actionable alert.

Only then schedule unattended runs. If the job is hosted on a scheduler with a 900-second execution ceiling, use a cron trigger plus a queue worker for longer work; the worker must preserve the attempt's idempotency when delivery repeats. Retire the previous record only under the overlap policy supported by the provider. The release criterion is compact: the job can demonstrate completion, and it can demonstrate that an operator hears about incomplete work.

References

These primary references support checking the authentication standard and the alternative service boundaries; they aren't comparative deliverability measurements.

Sources