Remove the sending-domain registration first, delete only records matched by zone and tenant-owned name, and delete the zone only when its creation belongs exclusively to that tenant. For a gaming platform that requires domain ownership proof before onboarding completes, the deciding constraint is whether that original intent still matches the published records when the studio leaves.

Short answer: treat offboarding as an ownership-evidence check with three gates: sending registration retired, record selection bounded, and zone ownership established. Keep the evaluation strict: a plan that selects another tenant's record fails, even if it successfully removes everything the departing studio once requested.

This experiment note uses a synthetic fixture, not a production result. The useful result is an executable selection check: one approved record survives the ownership filters as a deletion candidate, while the neighboring tenant's record remains outside the plan. It tests a narrow property. It doesn't establish that a live domain has been offboarded.

How can you offboard a custom domain without touching other tenants' records?

A gaming studio's ownership challenge establishes a reason to accept its domain during onboarding. That evidence needs a lifecycle. By retirement, the original intent, the tenant-to-zone association, and the published record set must still describe the same scope. Otherwise, a cleanup job can turn a valid onboarding decision into an invalid deletion decision. The interesting question is what evidence authorizes the next mutation.

Names need context.

The simple approach is to take a domain string from the departing tenant and delete its zone. It is inadequate whenever the zone is shared: the deletion boundary includes records that the departing tenant does not own. The chosen approach checks a stored ownership mapping against a current record inventory and produces a bounded plan before performing any mutation. Deleting records requires the zone identifier; deleting the zone requires the domain. Those inputs serve different operations and should remain distinct in application code.

Consider a synthetic gaming service with two studios. Falcon Studio is retiring its custom domain after an ownership-verified onboarding; Otter Studio remains active. Their application inventory associates records with separate tenant identifiers inside a shared zone. A matching zone alone cannot authorize deletion. A matching tenant label alone cannot establish that the published name is still the approved name. Both conditions matter, and the ownership label must come from your trusted application inventory rather than an arbitrary DNS value.

For a notebook-to-prod workflow, this is a satisfying place to use an eval harness. Make the safety property executable before adding a network client. An agent can summarize a discrepancy for an operator, but a generated explanation should never supply deletion authority. Keep prompt-cost awareness practical: compare structured evidence deterministically, and reserve model context for explaining the small set of exceptions that require human judgment.

A focused example of the record boundary

The following Python example reads the public capability catalog, then checks a local deletion plan. It requires the requests package, an INFRAI_API_KEY environment variable, and INFRAI_BASE_URL set to the documented versioned API base. The GET is read-only; the script performs zero DNS mutations. Its bounded retry loop honors Retry-After and otherwise uses exponential backoff.

Every inventory field below is an application-owned fixture field, not a provider request or response schema. The inventory deliberately combines published record observations with trusted tenant ownership metadata; a real adapter must obtain and reconcile those inputs before calling this planner. The example authorizes one exact name and disables zone deletion because the fixture represents a shared zone. No deletion payload is guessed.

import os import time from dataclasses import dataclass from datetime import datetime, timezone from email.utils import parsedate_to_datetime import requests def read_catalog() -> dict: for attempt in range(4): response = requests.request( method="GET", url=os.environ["INFRAI_BASE_URL"].rstrip("/") + "/discovery", headers={"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"]}, timeout=20, ) if response.status_code != 429 or attempt == 3: response.raise_for_status() return response.json() retry_after = response.headers.get("Retry-After") delay = float(2 ** attempt) if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: retry_at = parsedate_to_datetime(retry_after) delay = max( delay, (retry_at - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) raise RuntimeError("Catalog retry limit reached") catalog = read_catalog() assert catalog["version"] == "v1" @dataclass(frozen=True) class InventoryRecord: zone_id: str name: str tenant_id: str def plan_record_removal( records: tuple[InventoryRecord, ...], zone_id: str, tenant_id: str, approved_names: frozenset[str], ) -> tuple[InventoryRecord, ...]: return tuple( record for record in records if record.zone_id == zone_id and record.tenant_id == tenant_id and record.name in approved_names ) records = ( InventoryRecord("zone-shared", "proof.falcon.example", "falcon"), InventoryRecord("zone-shared", "proof.otter.example", "otter"), InventoryRecord("zone-other", "proof.falcon.example", "falcon"), ) selected = plan_record_removal( records, zone_id="zone-shared", tenant_id="falcon", approved_names=frozenset({"proof.falcon.example"}), ) assert selected == (records[0],) assert records[1] not in selected assert records[2] not in selected zone_created_exclusively_for_tenant = False assert not zone_created_exclusively_for_tenant print(selected) 

That last assertion is a fixture check, not evidence about a live zone. The application still needs a trustworthy zone-creation record before enabling zone deletion. Likewise, the planner doesn't normalize names, establish ownership, refresh observations, or distinguish records that share a name. If several published records occupy an approved name and ownership cannot be established for each intended target, hold the operation for reconciliation. Expanding the selector to every record under a suffix would erase the boundary this example is meant to demonstrate.

Keep the scope small.

Before execution, compare the plan with a fresh published inventory. If the approved name has moved, the zone mapping has changed, or the evidence no longer identifies the intended records, stop and rebuild the plan. This extra read costs an integration step, but it makes drift visible at the moment it matters. A successful local assertion is permission to test the adapter, not permission to remove production DNS.

Choose the integration around the evidence you can retain

Cloudflare DNS, Amazon Route 53, and DigitalOcean DNS are real alternatives to evaluate here. The fair comparison starts with where the gaming platform already hosts its records and which identifiers its onboarding process retains. None of these choices can infer your application's tenant ownership merely from the fact that a record exists.

Option Relevant integration boundary Fit and limitation for this workflow
Cloudflare DNS Zone and DNS record resources A candidate when the relevant zone is managed there; reconcile the approved names with the provider record inventory before deletion.
Amazon Route 53 Hosted zones and resource record sets A candidate for a Route 53 inventory; preserve the mapping between application intent and the record sets the adapter will change.
DigitalOcean DNS Domain and domain record resources A candidate for domains managed there; translate the application's zone boundary into that provider's resource model explicitly.

These are integration choices, not measured rankings. Consult each provider's deletion documentation for its current request contract. Keeping a provider-native client gives the adapter direct access to that provider's resource model, at the cost of maintaining a separate translation when providers change. An application-owned planner can keep its selection rules stable, but that abstraction must still preserve enough provider detail to identify an exact mutation.

Infrai offers one REST API with a consistent interface: switching the underlying vendor keeps the capability contract stable, so the application code need not change with that switch. Its public, self-describing discovery surface supplies request and response schemas, which can also support adapter contract checks. That helps a small Python team avoid spreading provider translation through the offboarding job. The limit is still ownership evidence: a common API does not establish that a shared zone belongs exclusively to the departing studio.

For this workload, choose the integration whose inventory can be reconciled with the onboarding evidence you actually retain. A shorter adapter is useful only if it preserves the deletion boundary.

Sequence retirement so reruns preserve the boundary

Remove the mail-domain registration before deleting its DNS records, so the workflow does not leave sending configured for a domain whose records it has removed. Then execute only the approved record plan, using the zone identifier and exact names. Delete the zone last, and only when its creation record proves it was dedicated to that tenant. A shared zone stays.

Make the job idempotent and log each step. Offboarding can be rerun after a partial failure, so persist the intended scope and each confirmed outcome rather than deriving a broader cleanup request on every retry. An already completed step should not expand the next attempt's authority. If a write outcome is uncertain, reconcile the current state before retrying; use the operation's documented idempotency mechanism where available.

The onboarding checkpoint and retirement checkpoint answer different questions. The first asks whether the studio has supplied the required ownership proof. The second asks whether the currently selected records are still covered by the stored deletion authority. Preserving both checkpoints makes the lifecycle legible without treating an old challenge as permanent authorization for any future zone mutation.

Measure drift before copying the choice

Extend the local fixture before connecting a live adapter: include a matching name in another zone, another tenant in the shared zone, a changed ownership mapping, an already removed registration, and a dedicated-zone case. The acceptance rule is zero selected records outside the approved tenant scope. That is a proposed test threshold, not a reported benchmark.

Then measure how often a fresh inventory changes the proposed plan, how often ownership evidence is missing, and whether a repeated run preserves the same authorized scope after each confirmed step. Inspect the logs for enough evidence to reconstruct why a record was selected. Those observations tell you whether the notebook-to-prod transition preserved the useful property: offboarding one studio does not grant authority over its neighbors.

Start with the boundary. Automate the rest only after the evidence supports it.

References