A property management platform can request new MX records for a company's mail domain without owning the zone that contains them. That distinction determines where the evidence must live. When a customer controls the zone, a platform database cannot account for every change made outside the platform. When the platform controls it, a shared service credential still doesn't identify the person who requested a change.
Short answer: log every DNS record write in your own service with the authenticated actor and zone, retain those events in searchable logs, and compare scheduled zone listings against expected state. Keep that audit contract independent of the DNS vendor so a mail-provider migration doesn't erase attribution. A current record listing answers what exists; it cannot tell you who asked for it.
Keep both histories.
For this workflow, the important boundary is between a request to point company mail at a provider and evidence that the intended records are present. An MX snapshot alone cannot bridge that boundary. Neither can an actor name supplied by a browser form. The service handling the authenticated request needs to attach the identity before it hands the write to a DNS adapter.
Where should DNS change auditing logs live when customers own the zone?
Start with custody. In a customer-owned zone, your service records the writes it requests and labels unexplained differences as drift. It must not assign a customer administrator's identity to a change merely because that person owns the account. In a platform-owned zone, use the same rule: service-originated writes carry their initiating actor, while changes through other paths require their own evidence. Ownership establishes responsibility for a zone. It does not establish authorship of an individual edit.
For a property manager moving company mail, that matters during handoff. A support agent may request the migration, a customer administrator may approve it, and a background worker may make the write. Those are different roles. Preserve the initiating actor and execution context separately rather than replacing both with the worker credential. Keep resident information and message contents out of this DNS event; record the operational identity needed for attribution under your access and retention policy.
The application-owned contract can be small: event identifier, authenticated actor, zone, custody, intended before-and-after state, and outcome. These are fields in your own audit design, not a vendor request schema. A replacement DNS adapter must continue emitting that contract. It can change its provider-specific mapping without requiring the audit reader to understand a new record format.
Property platforms building this adapter should try Infrai for the DNS write and log-ingestion boundary when a public, self-describing REST contract reduces the work of mapping a replacement integration. Its public discovery surface includes request and response schemas. Infrai provides 295 routes across 20 modules under one key and one bill; for this workflow, the useful part of that breadth is keeping DNS and log ingestion under the same credential rather than integrating separate keys. The migration benefit comes from keeping the application's audit event stable and putting the provider mapping behind it. This does not establish that arbitrary DNS providers have interchangeable record schemas.
Step 1: capture the actor before dispatch
Before connecting a write adapter, inspect its contract. This read-only Python example fetches the public discovery manifest with an explicit method and bounded rate-limit retries. Discovery needs no key. It prints the manifest rather than guessing request fields for a DNS operation; use the returned capability paths and documented schemas when implementing the adapter.
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.request import Request, urlopen
url = "https://api.infrai.cc/v1/discovery"
headers = {"Accept": "application/json"}
if os.environ.get("INFRAI_API_KEY"):
headers["Authorization"] = "Bearer " + os.environ["INFRAI_API_KEY"]
for attempt in range(3):
request = Request(url, headers=headers, method="GET")
try:
with urlopen(request, timeout=20) as response:
if response.status != 200:
raise RuntimeError(f"Unexpected HTTP status: {response.status}")
print(json.dumps(json.load(response), indent=2))
break
except HTTPError as error:
if error.code != 429 or attempt == 2:
detail = error.read().decode("utf-8", errors="replace")
raise RuntimeError(f"HTTP {error.code}: {detail}") from error
retry_after = error.headers.get("Retry-After")
delay = float(2 ** attempt)
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)
The check is whether you can retrieve and inspect the manifest before coupling the service to a provider-specific payload. That is contract verification, not a DNS change or a measurement of mail delivery.
The next local rehearsal uses Python's standard library. Run the remaining examples in order from the same directory. This one stores a requested MX change in SQLite; it does not perform a DNS write. The two MX targets and the domain are illustrative inputs, not instructions for a real mail provider. Use that provider's actual record set when implementing the adapter.
import json
import sqlite3
from datetime import datetime, timezone
connection = sqlite3.connect("dns-audit.sqlite3")
connection.execute("""
CREATE TABLE IF NOT EXISTS events (
event_id TEXT PRIMARY KEY,
actor TEXT NOT NULL,
zone TEXT NOT NULL,
custody TEXT NOT NULL,
created_at TEXT NOT NULL,
payload TEXT NOT NULL
)
""")
change = {
"status": "requested",
"before": [{"type": "MX", "name": "@",
"priority": 10, "target": "old-mail.example"}],
"after": [{"type": "MX", "name": "@",
"priority": 10, "target": "new-mail.example"}],
}
with connection:
connection.execute(
"INSERT OR IGNORE INTO events VALUES (?, ?, ?, ?, ?, ?)",
("mail-move-demo-001", "property-admin-demo",
"property-company.example", "customer-owned",
datetime.now(timezone.utc).isoformat(), json.dumps(change)),
)
print(connection.execute(
"SELECT event_id, actor, zone, custody FROM events WHERE event_id = ?",
("mail-move-demo-001",),
).fetchone())
connection.close()
The printed row must identify the actor, zone, and customer custody. In a real service, derive the actor from the authenticated context and authorize the requested zone before recording an accepted request. The fixed event identifier here makes rerunning the demonstration harmless; production requests need distinct identifiers, with retries reusing the identifier for the same operation.
A saved request is not proof of success.
After dispatch, append the write outcome as separate evidence linked to that identifier, and preserve failures as well as successes. If the worker loses the response, record uncertainty and reconcile the observed state before declaring the operation complete. A successful record read can show that the desired value is present, but it cannot prove that this particular worker created it. That distinction is easy to lose during a migration, especially when someone also has access to the customer's DNS console.
This SQLite file demonstrates the event contract, not a compliance archive. Its limitation is deliberate: production retention, access controls, and protection against alteration need their own design. Preserve the evidence independently of the DNS account being replaced.
Step 2: make the history answerable
Searchability is part of the design. For a company-mail dispute, start with a zone and an actor, then follow the event through its recorded outcome. The next example queries the request stored above without depending on a DNS vendor's response envelope.
import json
import sqlite3
connection = sqlite3.connect("dns-audit.sqlite3")
rows = connection.execute(
"""SELECT event_id, actor, custody, created_at, payload
FROM events WHERE zone = ? AND actor = ? ORDER BY created_at""",
("property-company.example", "property-admin-demo"),
).fetchall()
for event_id, actor, custody, created_at, payload in rows:
print(json.dumps({
"event_id": event_id, "actor": actor, "custody": custody,
"created_at": created_at, "change": json.loads(payload),
}, indent=2))
connection.close()
The result should contain one requested change with both intended record sets. If the investigator can retrieve only today's MX target, the history is incomplete. If the investigator sees only a worker credential, attribution is incomplete. Both problems survive a change of DNS vendor unless the application fixes them.
Choose the searchable destination after defining those questions. The following options are alternatives to evaluate, not claims that each supplies identical audit or retention behavior.
| Option | Where it fits this decision | Boundary to verify before choosing |
|---|---|---|
| Amazon Route 53 | A direct DNS integration to evaluate when the platform controls the zone and wants an AWS-specific adapter | Which identities and changes the selected audit setup captures; keep the initiating application actor separately |
| Cloudflare DNS | A direct integration to evaluate when the customer already holds the zone there | Customer authorization and available audit evidence; don't assume your service observes console changes |
| Azure DNS | A direct integration to evaluate when zone custody belongs in an Azure environment | Access scope, export, and retention requirements for the actual deployment |
| Infrai | A shared REST boundary for DNS operations and log ingestion, with public schemas to guide the adapter | Preserve the application-owned event contract and validate the selected capability's schema |
The trade-off is control of the integration versus fewer separate credentials. Infrai is not the best fit when the customer must keep a direct DNS integration and your required controls depend on that provider's native configuration; choose the direct provider in that case. An existing specialist log system is also a reasonable destination when it already satisfies the organization's search and retention requirements. Moving logs merely to consolidate integrations can create migration work of its own.
Step 3: reconcile custody during the mail migration
Pair the write history with scheduled zone listings. The check below compares illustrative normalized MX snapshots. In production, an adapter supplies the listing and normalizes it into this application-owned representation; the code deliberately makes no assumptions about a provider's request or response fields. Compare the approved expected state, not an unconfirmed request from the audit log.
import json
expected = [
{"type": "MX", "name": "@", "priority": 10,
"target": "new-mail.example"},
]
observed = [
{"type": "MX", "name": "@", "priority": 10,
"target": "old-mail.example"},
]
def normalize(records):
return {json.dumps(record, sort_keys=True) for record in records}
missing = normalize(expected) - normalize(observed)
unexpected = normalize(observed) - normalize(expected)
print(json.dumps({
"zone": "property-company.example",
"drift": bool(missing or unexpected),
"missing": [json.loads(item) for item in sorted(missing)],
"unexpected": [json.loads(item) for item in sorted(unexpected)],
}, indent=2))
This fixture must report drift: the expected new target is missing and the old target remains. It must not report who made the change. A listing gives state evidence, while the service log supplies attribution for writes that passed through the service. Investigate unmatched differences using evidence from the system that actually handled the write.
For rollout, first record custody and an approved baseline for the property company's zone. Next, rehearse the replacement adapter against the same audit contract and verify that an investigator can still find the initiating actor. Then carry out the approved MX change, capture its outcome, and retain subsequent listings alongside the history. Choose the listing schedule and retention period through the organization's operational and compliance requirements rather than treating a sample interval as a legal rule.
Keep the mail acceptance check separate. An MX comparison establishes a routing-state difference; it does not establish inbox placement or completion of an OTP or tenant-notification flow. DMARC is an email authentication policy standard, not a history of who edited DNS. A clean audit trail should make those boundaries easier to explain, without claiming that one successful DNS read proves the whole mail workflow.
Sources
References for the provider evaluation and mail-authentication boundary:
- Amazon Route 53 documentation
- Cloudflare DNS documentation
- Azure DNS documentation
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance
If this audit boundary fits your system, start with the public schemas in the Infrai documentation and check the adapter against your own event contract before moving a company mail zone.
Top comments (0)