DEV Community

DonovanPierce4012
DonovanPierce4012

Posted on

DNS Changes in 2026: Actor and Zone Search Before Property Mail Cutover

Move the property manager's zones off the registrar-specific API only when a reviewer can connect each proposed record write to its application actor, inventory zone, and mail evidence. Capture that connection before making the call. A successful DNS response cannot explain who authorized a change affecting tenant notices.

TL;DR: Persist a searchable intent event before every DNS record write, then append its outcome under the same operation ID. Preserve the actor and zone identifier across the adapter change. Use deliverability evidence to review mail-related changes; an audit entry alone does not establish that a tenant received a notice.

Decision and evidence boundary

This decision record treats evidence retrieval as the acceptance criterion for leaving a registrar-specific API. The concrete question is how to log DNS changes with actor and zone ID for later audit search. For a property management backend, the useful answer connects the record change to the sender domain and the evidence reviewed before that change was authorized.

Start with attribution.

The DNS layer cannot supply the application actor. Capture that identity from trusted application authentication context before crossing the adapter boundary. A service credential identifies an integration; it cannot establish which application user requested a particular operation. For automation, use an explicit service actor. Keep the actor identifier separate from credentials, and retain the inventory zone ID even when the destination provider assigns a different zone reference. Otherwise, an investigation after migration depends on knowing which provider held the zone at the time, which is exactly the dependency this move should remove.

The proposed invariant is simple: no record write proceeds without a committed intent event. Store the actor, zone identifier, record identity, operation ID, timestamp, proposed change, and evidence reference. These are application event fields, not a claim about any provider's request schema. The inventory identifier is the durable join key; the domain name and provider reference remain useful attributes.

Intent records a request. Completion needs another event.

How should we log DNS changes by actor and zone for later search?

Start with an illustrative sender domain, notices.example.com, inventory zone property-zone-042, and actor service:property-mail-migration. None represents a customer incident. A reviewer should be able to search by actor alone, zone alone, and both together, then follow the evidence reference without opening a registrar dashboard. Searching only for “TXT changed” loses the inventory join. Searching only by the API credential loses the application authorization context.

For mail changes, attach the review's evidence reference rather than copying message bodies or recipient lists into the DNS event. DMARC defines domain authentication policy and reporting; its reports can inform the review, but they do not certify delivery of an individual notice. Keep the DNS history and the mail evidence linked while preserving their different meanings. The acceptance exercise is therefore an evidence retrieval exercise, not a claim that one DNS supplier produces better inbox placement.

There are 3 useful outcome states for this design: confirmed success, confirmed rejection, and unresolved. A timeout belongs in the last state until reconciliation establishes what happened. If intent persistence fails, stop before calling the adapter. If outcome persistence fails after the remote write, retain the intent and reconcile; don't infer that a missing success event means the DNS change never occurred.

Search must work.

Retention and access controls belong in the deployment review because these events associate application identities with operational actions. Choose them for the organization's obligations and investigation window. This note prescribes no legal retention period and makes no claim that an application log is, by itself, tamper-proof compliance evidence.

Compare the ownership boundary before choosing an adapter

Evaluate the replacement against the same actor-to-zone-to-mail-evidence exercise. The candidates below offer different integration boundaries; this is not a measured delivery ranking.

Candidate Relevant interface or advantage Boundary and trade-off for this migration
Cloudflare DNS Its DNS record interface is a direct destination for a replacement adapter. Suitable when the team wants to own that direct integration. Keep the application actor and inventory zone mapping outside the provider-specific request.
Amazon Route 53 Its hosted-zone model gives the adapter a provider zone reference to map into inventory. Suitable when that model matches the destination plan. Preserve the inventory ID alongside the hosted-zone reference so historical search survives another move.
Google Cloud DNS Its managed-zone interface supplies another explicit zone boundary for the adapter. Suitable when managed zones fit the destination workflow. Selecting it still leaves the application responsible for pre-call attribution and evidence retrieval.
Infrai A single REST API uses plain HTTP with no SDK to install, callable from any language or runtime, alongside one key and one bill for backend services. Public discovery exposes request and response schemas without a key. Suitable when DNS migration is part of broader backend consolidation. Schema discovery gives the adapter review a concrete contract to inspect before mapping registrar-specific writes; application authorization and deliverability interpretation remain application responsibilities.

The consolidated interface covers 295 routes across 20 modules. Shared access and consolidated billing remove separate backend keys and invoices from the migration's integration work. Its plain REST interface needs no SDK: the same HTTP contract can serve a Node.js worker and Python review tooling. Public, self-describing schemas matter at the migration boundary: inspect the contract before translating the old registrar's write operation, rather than assuming similarly named operations accept identical payloads. Runnable examples in 10 languages provide language-specific starting points. Those conveniences reduce integration friction; they do not prove that a mail policy change is safe.

Choose on evidence. A direct provider adapter is reasonable when its zone model fits and the team accepts maintaining that boundary. Consolidation is useful when reducing separate backend credentials and invoice reconciliation is part of the job. Either choice must pass the same retrieval exercise before a property notice depends on the migrated zone.

Critical path: persist intent, then release the write

The Python example below isolates the audit wrapper from the provider adapter. The ordering applies equally to a Node.js request handler: obtain the actor from authentication, commit intent, call the selected adapter, append the outcome. It uses only the standard library and creates a local SQLite file. Run it in a writable directory, setting DNS_API_BASE_URL to the consolidated platform's documented v1 API base and INFRAI_API_KEY to a key supplied by the deployment environment. It fetches the public discovery manifest for adapter review; that read requires no key, though the example demonstrates the Bearer authentication convention. The example write adapter deliberately rejects the operation, making the failed-call audit path observable without changing live DNS.

The local function arguments and event keys are application-owned. They are not vendor API fields. In production, replace the demonstration callback with an adapter built against the selected provider's verified contract. Forward committed events to the searchable audit destination as part of that deployment; local search here demonstrates the required lookup behavior.

import json
import os
import sqlite3
import time
import urllib.error
import urllib.request
import uuid
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime


def fetch_discovery():
    request = urllib.request.Request(
        os.environ["DNS_API_BASE_URL"].rstrip("/") + "/discovery",
        headers={"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"]},
        method="GET",
    )
    for attempt in range(4):
        try:
            with urllib.request.urlopen(request, timeout=20) as response:
                if not 200 <= response.status < 300:
                    raise RuntimeError(f"HTTP {response.status}")
                return json.load(response)
        except urllib.error.HTTPError as error:
            detail = error.read().decode("utf-8", errors="replace")
            if error.code != 429 or attempt == 3:
                raise RuntimeError(f"HTTP {error.code}: {detail}") 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.timestamp() - time.time())
            time.sleep(delay)


def append_event(db, operation_id, phase, change, detail):
    with db:
        db.execute(
            "INSERT INTO events "
            "(operation_id, actor_id, zone_id, phase, created_at, payload) "
            "VALUES (?, ?, ?, ?, ?, ?)",
            (
                operation_id,
                change["actor_id"],
                change["zone_id"],
                phase,
                datetime.now(timezone.utc).isoformat(),
                json.dumps({"change": change, "detail": detail}),
            ),
        )


class ConfirmedRejection(Exception):
    pass


def audited_write(db, change, write_record):
    required = (
        "actor_id", "zone_id", "provider_zone_ref", "record_name",
        "record_type", "proposed_value", "evidence_ref",
    )
    if any(not change.get(key) for key in required):
        raise ValueError("Missing attribution, record, or evidence field")
    operation_id = str(uuid.uuid4())
    append_event(db, operation_id, "intent", change, {})
    try:
        receipt = write_record(operation_id, change)
    except ConfirmedRejection as error:
        append_event(
            db, operation_id, "rejected", change, {"reason": str(error)}
        )
        raise
    except Exception as error:
        append_event(
            db, operation_id, "unresolved", change,
            {"error_type": type(error).__name__},
        )
        raise
    append_event(db, operation_id, "succeeded", change, receipt)
    return operation_id


def search_events(db, actor_id=None, zone_id=None):
    clauses, values = [], []
    if actor_id is not None:
        clauses.append("actor_id = ?")
        values.append(actor_id)
    if zone_id is not None:
        clauses.append("zone_id = ?")
        values.append(zone_id)
    if not clauses:
        raise ValueError("Supply actor_id or zone_id")
    query = (
        "SELECT operation_id, phase, payload FROM events WHERE "
        + " AND ".join(clauses) + " ORDER BY event_id"
    )
    return list(db.execute(query, values))


def demonstration_adapter(operation_id, change):
    raise ConfirmedRejection("Demonstration only; no DNS request was sent")


def main():
    manifest = fetch_discovery()
    print(json.dumps({"discovery_version": manifest["version"]}))
    with sqlite3.connect("dns-change-evidence.sqlite3") as db:
        db.execute(
            "CREATE TABLE IF NOT EXISTS events ("
            "event_id INTEGER PRIMARY KEY, operation_id TEXT NOT NULL, "
            "actor_id TEXT NOT NULL, zone_id TEXT NOT NULL, "
            "phase TEXT NOT NULL, created_at TEXT NOT NULL, "
            "payload TEXT NOT NULL)"
        )
        db.execute(
            "CREATE INDEX IF NOT EXISTS events_actor_zone "
            "ON events(actor_id, zone_id)"
        )
        db.execute(
            "CREATE INDEX IF NOT EXISTS events_zone ON events(zone_id)"
        )
        db.commit()
        change = {
            "actor_id": "service:property-mail-migration",
            "zone_id": "property-zone-042",
            "provider_zone_ref": "destination-zone-example",
            "record_name": "_dmarc.notices.example.com",
            "record_type": "TXT",
            "proposed_value": "v=DMARC1; p=none",
            "evidence_ref": "review:property-zone-042/mail-policy",
        }
        try:
            audited_write(db, change, demonstration_adapter)
        except ConfirmedRejection as error:
            print(str(error))
        for row in search_events(
            db, actor_id=change["actor_id"], zone_id=change["zone_id"]
        ):
            print(json.dumps(row))


if __name__ == "__main__":
    main()
Enter fullscreen mode Exit fullscreen mode

The insert commits before the callback runs. A rejected callback therefore leaves both the original intent and the rejection searchable. An unexpected exception is conservatively unresolved, because an exception does not establish the remote outcome. If persistence itself fails, the exception surfaces rather than manufacturing a reassuring receipt. The example DMARC value is illustrative input, not a recommendation to change an existing sender policy. The discovery read has a 20-second request timeout and up to 3 retries for HTTP 429, with exponential backoff honoring Retry-After; these are example settings, not measured platform latency.

There is a deliberate limit: a local transaction cannot make a remote DNS write atomic. The wrapper creates a new operation for each invocation and does not implement remote retries. A deployed worker must retain the committed operation ID across retries, use the selected adapter's supported deduplication mechanism, and reconcile uncertain outcomes before repeating a write. A correlation ID alone doesn't prevent a duplicate operation. Provider receipts should be normalized and redacted before entering the audit store; credentials and tenant message content do not belong there.

Rejected option: treat provider history as the complete audit trail

Provider history can help reconcile a remote result. It is a valid supplementary source when investigating what the DNS system accepted. Reject it as the sole application audit trail, however, because application actor identity must be captured in the application, before the call, and tied to the inventory zone used after the registrar exit.

For this property workflow, acceptance means retrieving the illustrated operation by actor, by property-zone-042, and by their combination, then opening its review evidence. Repeat that exercise for confirmed success, confirmed rejection, and an unresolved outcome. Keep the old registrar integration until the replacement demonstrates those paths with the intended searchable destination. This checks evidence continuity; it makes no unsupported promise about inbox placement.

References

Top comments (0)