A gaming company's mail migration needs DNS change auditing that preserves who changed each record in searchable logs. It also has two clocks: the moment an authorized engineer changes the MX records, and the point at which the team is ready to accept the cutover. A faster control-plane update doesn't, by itself, settle that second decision.
TL;DR: Keep the record of who changed what in searchable application audit logs, written where your service knows the actor and zone. Pair those events with scheduled zone listings to detect changes outside your service. During a company-mail cutover, treat authorization evidence and propagation evidence as separate acceptance checks.
This note uses a fictional gaming studio, guild.example, to make that distinction concrete. The decision axis is cutover speed versus the time allowed to observe propagation. The question is evidence custody: which system should preserve each assertion, and what can that assertion actually prove?
1. Where should the DNS change audit record live?
At the call site.
The service accepting the change knows which authenticated actor requested it and which zone the request concerns. A current-state DNS listing answers a different question: what exists now? Reading an MX record later cannot reconstruct who requested the write, why the company switched mail providers, or which approval allowed it.
For the studio, the audit event should bind the actor and zone to the intended MX change and its eventual outcome. Preserve the requested difference, a correlation identifier, the approval reference, and timestamps as an application-owned event design. These are proposed fields for your audit store, not a provider's documented request schema. Keep mailbox contents and OTP values out of this trail; they add exposure without explaining who authorized a DNS change.
Record intent first. Then attach the write result, including an uncertain result when the application cannot establish the outcome. A successful request and a failed request must not become indistinguishable entries labeled “changed.”
That distinction matters.
Don't guess ownership.
The audit store should support searches by actor, zone, time, and change identifier. Retention, access restrictions, and the handling of personal identifiers belong in the company's compliance policy; choosing a DNS API does not establish those policies. A folder of exported logs is insufficient if the on-call engineer cannot find the relevant event during a mail cutover.
2. Keep three kinds of evidence separate
Use three checks: actor evidence from the application, state evidence from scheduled zone listings, and a separately recorded decision about mail readiness. Combining them into one green indicator makes a quick write look more conclusive than it is.
| Evidence | What it establishes | What remains unproven |
|---|---|---|
| Application change event | The actor and zone associated with the request | That the requested state is now present |
| Scheduled zone listing | The records visible through the control plane at that observation | The identity behind an unexplained external change |
| Cutover acceptance record | Which checks the team reviewed before proceeding | Anything those checks did not actually observe |
Compare each scheduled listing with the expected state associated with authorized changes. If the MX target differs and no matching event exists, flag unexplained drift. Do not manufacture an actor from a matching timestamp. An external change needs investigation and its own evidence.
For a deliverability review, keep the questions narrow. Pointing incoming company mail at a provider with MX records and checking mail authentication are related tasks, but they should have distinct acceptance criteria. DMARC is relevant to the authentication review; its specification is not evidence that an MX cutover has propagated.
The speed trade-off follows from that separation. You can submit the change promptly while keeping the acceptance decision open. Choose the observation window before the migration, document its basis, and preserve the observations used to close it. No universal waiting period follows from a successful API response. For the fictional studio, a listing that matches the intended MX target can close the control-plane check while the mail-readiness check remains open; forcing those checks into a single status would discard exactly the distinction the migration owner needs. The benefit of keeping separate evidence is a defensible acceptance decision. The cost is more reconciliation work and an explicit owner for closing the migration.
Keep both clocks.
3. Carry the observed domain into the mail check
The useful integration is the handoff: inspect the DNS listing, extract the domain from that response, and use it for the mail-domain lookup. The following Python program performs those two reads with the same API key and base URL. It does not write records or declare propagation complete.
Request and response field names must come from the deployed capability schema. Rather than guess them, this example accepts the documented DNS query as JSON and a JSON Pointer identifying the domain string in the returned listing. Those two settings are application configuration, not API fields. Set API_BASE_URL to the deployment's documented v1 base URL, INFRAI_API_KEY to its key, DNS_LIST_QUERY_JSON to the documented query object, and DNS_DOMAIN_POINTER to the pointer for your response. The program uses only the Python standard library.
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, urlencode
from urllib.request import Request, urlopen
BASE = os.environ["API_BASE_URL"].rstrip("/")
KEY = os.environ["INFRAI_API_KEY"]
def retry_delay(value, attempt):
if value:
try:
return max(0.0, float(value))
except ValueError:
try:
when = parsedate_to_datetime(value)
return max(
0.0, (when - datetime.now(timezone.utc)).total_seconds()
)
except (ValueError, TypeError, OverflowError):
pass
return 2 ** attempt
def get_json(path, query=None):
suffix = "?" + urlencode(query, doseq=True) if query else ""
for attempt in range(4):
request = Request(
BASE + path + suffix,
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:
if error.code != 429 or attempt == 3:
reason = error.read().decode("utf-8", errors="replace")
raise RuntimeError(f"HTTP {error.code}: {reason}") from error
time.sleep(retry_delay(error.headers.get("Retry-After"), attempt))
def at_pointer(document, pointer):
if pointer == "":
return document
if not pointer.startswith("/"):
raise ValueError("JSON Pointer must start 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
query = json.loads(os.environ["DNS_LIST_QUERY_JSON"])
if not isinstance(query, dict):
raise ValueError("DNS_LIST_QUERY_JSON must contain an object")
listing = get_json("/dns/record/list", query)
domain = at_pointer(listing, os.environ["DNS_DOMAIN_POINTER"])
if not isinstance(domain, str) or not domain.strip():
raise ValueError("Selected DNS response value must be a domain string")
mail_domain = get_json("/email/domain/get/" + quote(domain, safe=""))
print(json.dumps({"dns": listing, "mail_domain": mail_domain}, indent=2))
The limit of 4 attempts and request timeout of 30 seconds are example client choices, not service guarantees. A 429 response triggers a bounded retry count with exponential backoff and respect for Retry-After. Other HTTP errors surface their response body. Both operations are reads, so this example has no create or publish retry to deduplicate.
Run this in an authorized environment. Store the resulting observations with the migration evidence under the appropriate access policy; terminal output alone is not the searchable audit trail. If the selected response value is not the intended company domain, correct the configured pointer before using the observation to approve a cutover.
4. Compare custody boundaries before choosing a stack
A fair comparison starts with who owns the evidence. Amazon Route 53, Cloudflare DNS, and a combined backend API can all be evaluated against the same requirement: retain the application's actor context and reconcile it with observed DNS state. Amazon SES and Resend belong in the comparison because the receiving end of the handoff is a mail service, not merely a DNS console.
| Candidate arrangement | Useful fit | Boundary to account for |
|---|---|---|
| Amazon Route 53 with Amazon SES | A team choosing both DNS and mail services within AWS | Two services under one cloud account; decide how application identity maps to service permissions and audit evidence |
| Cloudflare DNS with Resend | A team deliberately selecting DNS and email independently | Two vendor signups and two service credential sets; the application owns the domain and record handoff |
| Cloudflare DNS with Amazon SES | A team keeping DNS with Cloudflare while selecting AWS mail | Two vendor signups and credentials for both services; preserve the link between the DNS request and mail-domain checks |
| A combined DNS and email API | A team prioritizing one authenticated integration across the handoff | Evaluate the combined dependency and keep actor evidence in the application |
Infrai fits the final row with a plain REST API and a single API key across 295 routes / 20 modules, including DNS and email. Anything that sends HTTP requests can call it, with no SDK installation or client-library version to maintain. This single-key integration and unified billing mean the handoff doesn't require distributing a second service credential or reconciling a second vendor invoice. The API is self-describing: public discovery requires no key and supplies request and response schemas that can guide the handoff configuration.
That shared key can move SPF/DKIM coordination into an explicit application workflow instead of leaving it as a copy-paste between two dashboards after a rotation. It does not automatically prove that the records are correct. The application still needs to preserve intent, inspect the relevant state, and record its acceptance decision.
For the split stacks, the glue is yours: carry the domain between services, map the mail service's requirements to DNS changes, correlate the responses, and schedule reconciliation. Route 53 plus SES does not require two vendor signups, and it need not mean two unrelated static secrets; count service authorization boundaries honestly. Cloudflare plus Resend has two vendor accounts and separate service credentials.
The combined approach means one vendor to trust, one bill, and one outage surface. Choose that concentration deliberately. It may reduce integration administration, but it cannot replace the audit policy or justify a faster acceptance window by itself.
5. Roll out around an explicit acceptance decision
Before changing the studio's MX records, capture the current zone listing, establish the actor and approval reference, and define the evidence required to accept the migration. Include the intended incoming-mail destination and the separate authentication checks in that plan. Keep the previous state available to the authorized migration team.
During the change, preserve intent and outcome, then attach subsequent DNS and mail-domain observations to the same migration identifier. Treat unexplained drift as a reason to investigate before approving the next step. Avoid placing mailbox content in the evidence bundle.
Close the migration when the agreed checks pass and an authorized owner records acceptance. A control-plane write can be fast. The evidence must explain why the team considered the company-mail cutover ready.
Sources
References for the service boundaries and mail-authentication review:
Top comments (0)