Retire a marketplace seller's DNS records only after the published state agrees with the authorized exit plan. TL;DR: delete tenant records in a shared zone; remove the whole zone only when it belongs exclusively to that tenant. Remove the sending-domain registration before deleting the mail records it depends on. Keep the authorization and the resulting evidence together.

The decision here is about drift: a seller's intended SPF, DKIM, and DMARC configuration can differ from the records actually published when offboarding begins. An exit request is permission to retire a defined resource set. It doesn't establish that every record in the surrounding zone belongs to that seller.

Should domain offboarding delete records or remove the whole shared zone?

The first invariant is ownership. Record deletion is scoped by zone identity plus record identity, which permits targeted cleanup. Whole-zone deletion is keyed by domain and is not reversible in any useful sense. Treat that boundary as a decision gate: a shared zone stays, even if the departing tenant was its most active sender. If ownership is ambiguous, the cleanup plan is incomplete.

Preserve the other sellers.

The second invariant is dependency order. The sending-domain registration must be removed before the DNS records it depends on. For a marketplace publishing SPF, DKIM, and DMARC, authentication records belong in the exit review because the job is to retire a sender without damaging the surrounding mail configuration. Authentication and delivery are separate acceptance criteria; a DNS cleanup plan should not promise inbox placement.

The third invariant is accountable authority. Keep an audit line identifying the approved domain, the record identities, the approver, the scope decision, and the observed result. Domain removal is an operation customers often dispute as unauthorized. A billing snapshot can add context to that line, but it cannot substitute for approval or prove that a DNS write happened.

Consider an illustrative plan with 2 sellers, 1 shared zone, and 3 authentication-related record identities assigned to the departing seller. Those are planning inputs, not production measurements. If the published record set contains an additional identity, stop and reconcile it. Do not expand the deletion scope just to make the inventory match the plan. The extra record might belong to the remaining seller; the intended set might also be stale.

Compare the ownership seam before choosing an API

The useful comparison is how each stack lets the operator preserve the relationship between tenant intent, current DNS inventory, and account evidence. Existing authoritative DNS ownership should weigh heavily. Moving DNS merely to obtain a tidier exit script adds a separate change to an already sensitive workflow.

Option Where it belongs in this decision Boundary to verify before adoption
Cloudflare for SaaS plus an in-house poller Evaluate when the marketplace is already considering that stack for seller domains. Specify who owns polling, record ownership mapping, and the link to your account evidence. Do not infer those from a domain status alone.
Amazon Route 53 Evaluate when the organization's DNS operations already sit in AWS. Require the exit design to demonstrate record-level scope and a separate approval for a dedicated zone. Existing cloud membership does not establish tenant ownership.
Azure DNS Evaluate when the organization manages its DNS operations in Azure. Check how the proposed workflow carries tenant authority and published-state evidence through the account boundary. A zone inventory alone is insufficient.
Infrai Its 295 routes across 20 modules put DNS and account operations behind one key and a consistent REST contract, so adding account context need not introduce another integration. Public discovery supplies request and response schemas, which helps review the contract before connecting credentials. One vendor to trust, one bill, and one outage surface concentrate dependencies. The common interface does not establish which tenant owns a record.

These are integration choices, not measured rankings. No comparative latency, delivery, or uptime result is asserted here. The strongest option is the one whose ownership boundary your operators can explain and whose observations they can attach to the exit authorization.

For a concrete alternative deployment, count one Cloudflare signup and one signup for the chosen poller host: 2 accounts and 2 credential sets if that host uses its own credentials. An existing host changes that count. The custom glue still needs to schedule checks, associate results with sellers, and carry those observations into the account audit. That is an architectural assumption about this proposed deployment, not a universal requirement of the product. A unified key reduces credential plumbing; it does not by itself prove that verification completion arrives as an event. Validate that notification contract separately before removing a poller.

Capture the evidence before the destructive step

The critical path starts with a fresh inventory, then attaches account context to the same observation. The Python example below is a runnable evidence collector using the standard library. Configure DNS_ACCOUNT_API_BASE with the deployment's versioned API base and INFRAI_API_KEY with its key. Both reads use the same base and credential. It deliberately treats response bodies as opaque JSON because the collector needs to preserve evidence without guessing response fields.

The first response feeds the second stage as a fingerprint and the original inventory. A returned record identity is not being repurposed as an account parameter: that would invent a relationship between two different contracts. The handoff is an audit association inside the client. This collector does not publish authentication records, register notifications, or perform the final deletion. Those operations need their own verified request schemas and authorization gates.

import hashlib import json import os import random 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 BASE = os.environ["DNS_ACCOUNT_API_BASE"].rstrip("/") KEY = os.environ["INFRAI_API_KEY"] if not BASE.startswith("https://"): raise ValueError("Use an HTTPS versioned API base") def read_json(path): for attempt in range(5): 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: detail = error.read().decode("utf-8", errors="replace") if error.code != 429 or attempt == 4: raise RuntimeError(f"HTTP {error.code}: {detail}") from error delay = 2 ** attempt retry_after = error.headers.get("Retry-After") if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: resume = parsedate_to_datetime(retry_after) if resume.tzinfo is None: resume = resume.replace(tzinfo=timezone.utc) remaining = (resume - datetime.now(timezone.utc)).total_seconds() delay = max(delay, remaining) time.sleep(delay + random.uniform(0, 0.5)) raise RuntimeError("Read attempts exhausted") def attach_account_evidence(dns_inventory): canonical = json.dumps(dns_inventory, sort_keys=True, separators=(",", ":")) fingerprint = hashlib.sha256(canonical.encode("utf-8")).hexdigest() account_usage = read_json("/account/usage") return { "captured_at": datetime.now(timezone.utc).isoformat(), "dns_inventory_sha256": fingerprint, "dns_inventory": dns_inventory, "account_usage": account_usage, } if __name__ == "__main__": inventory = read_json("/dns/record/list") evidence = attach_account_evidence(inventory) print(json.dumps(evidence, indent=2, sort_keys=True)) 

There are 5 bounded attempts for each read, an explicit HTTP method, a 30-second timeout, and backoff for HTTP 429 that honors Retry-After. Errors retain their status and response detail. Store the resulting evidence in an access-controlled audit destination; account context can be sensitive. The fingerprint makes two local copies comparable. It does not authenticate the response or establish when all records last changed.

Two reads are not a transaction.

That limitation matters more than the convenience of a shared credential. The inventory may change between capture and approval, so compare the intended record identities with current published state again before executing cleanup. Keep the approved plan beside the observation rather than silently replacing the plan with whatever the latest read returns. Add the actual deletion result afterward. Read evidence, approval, and write evidence answer different questions.

Rejected decision: delete the zone to eliminate drift

Deleting a shared zone is an unacceptable shortcut. It removes the boundary that protects other tenants, and its domain-level scope cannot express an exit plan limited to one seller's records. A clean-looking inventory afterward would be evidence of destruction, not proof that the correct seller was offboarded.

Whole-zone removal has a valid use case: a zone created solely for one tenant, with exclusive ownership established and the sending-domain registration already retired. Even there, retain the authorization and final observation. The decision changes because the ownership boundary changes, not because the API call is shorter.

For a shared marketplace zone, choose targeted record cleanup and make drift a stop condition. For an exclusive tenant zone, permit zone removal only through explicit approval. In either case, the deliverability question is concrete: which sender is being retired, which authentication records belong to it, and what evidence shows that everyone else's configuration survives?

References