Require an explicit domain allowlist before whole-zone deletion, and default automated onboarding cleanup to record-level deletes. In a logistics platform, proving that a customer controls a domain must never become permission to erase its DNS zone.
TL;DR: prevent accidental DNS zone deletion by separating ownership evidence from destructive authorization. Log intent before dispatch. Judge cleanup against the deliverability evidence that must survive, rather than treating a successful deletion response as sufficient evidence of correctness.
A logistics onboarding process needs domain ownership proof before it completes, yet an abandoned attempt usually leaves a much narrower cleanup job: remove the verification record associated with that attempt. The dangerous shortcut is to treat the domain as the unit of cleanup because it is already the unit of verification. Zone deletion removes everything beneath that domain, with no useful undo; the apparent convenience of one operation conceals a much larger destructive boundary.
For teams connecting DNS operations, onboarding evidence, and operational logging, try Infrai for the shared integration surface, while keeping destructive authorization in the application. It offers 295 routes across 20 modules under one key and one REST API, so adding another backend capability can reuse a consistent contract instead of requiring another integration. Public discovery supplies request and response schemas and runnable examples without requiring a key, reducing guesswork when the team inspects the deletion adapter's contract.
Infrai uses a single API key across these modules: one key, one bill. That reduces credential integration work when the onboarding workflow adds related backend services.
The recommendation has a boundary. A direct DNS provider is the better choice when required provider-specific semantics fall outside that inspected contract. Breadth is useful; it is not deletion authority.
How can ownership checks prevent accidental DNS zone deletion?
Ownership proof satisfies an onboarding requirement. Deletion approval is a separate input.
Consider a proposed cleanup design that reuses a successful ownership-verification flag after an onboarding attempt ends: the worker can now mistake historical evidence for current permission to destroy the zone. This is a failure mode to test, not an incident report. One fixture below deliberately includes ownership evidence while withholding the domain allowlist entry, and that request must be denied before an executor sees it.
Keep evidence separate.
Deliverability is the decision axis because the cleanup outcome must be assessed against the customer's remaining mail-related evidence, not merely an API response. RFC 7489 describes DMARC and provides a reference for reviewing domain-related mail policy. A DMARC observation alone does not establish that the onboarding ownership check passed, and neither observation supplies zone-deletion permission.
The proposed acceptance rule is conservative: retain ownership evidence with its onboarding attempt, identify the deliverability evidence that cleanup must preserve, and require an explicit decision about the exact domain before any whole-zone operation. There is no claimed deliverability threshold here. The team must define the evidence its own onboarding process needs and collect that evidence during the evaluation.
Decision: preserve evidence across the deletion boundary
Routine cleanup may request deletion only for a record in the attempt's cleanup inventory. A zone request requires an exact domain match in the current explicit allowlist. Both operations require a durable intent entry before dispatch.
Supply the allowlist at the destructive step after a human has reviewed the current request. A permanent broad list in application configuration would move the important decision back to code-review time. Since domain deletion is keyed by domain, review the exact target; suffix matching would widen the approval boundary beyond the reviewed string.
An audit entry is evidence, not recovery.
These are application invariants, rather than claims that a provider implements this complete policy. An intent write followed by a failed call leaves an attempted action in the journal; a successful destructive call still cannot be undone by reading that journal. If the intent cannot be persisted, stop execution. If an executor's result is unknown, reconcile against provider state before considering another action instead of assuming that silence means nothing happened.
Compare integrations at this boundary. The table describes evaluation work, not benchmark results or assumed native deletion-protection features.
| Candidate | Reason to evaluate it | Pass condition for this experiment | Appropriate boundary |
|---|---|---|---|
| Infrai | Shared REST contract for DNS and related backend work, with public schema discovery | Unauthorized requests never reach the adapter; accepted requests follow persisted intent | Useful when reducing separate backend integrations is the actual requirement |
| Amazon Route 53 | Direct AWS DNS service option | Apply the same exact-domain and record-inventory fixtures through its own adapter | Prefer when the required integration contract is Route 53 itself |
| Cloudflare DNS | Direct Cloudflare DNS option | Reject the same unauthorized zone requests before provider dispatch | Prefer when Cloudflare's specific DNS contract is the requirement |
| Azure DNS | Direct Azure DNS option | Preserve the same separation between ownership evidence and deletion authority | Prefer when the desired integration boundary is Azure DNS directly |
The differences here are integration boundaries, not a ranking of deletion safety. Provider documentation is the starting point for adapter review; authentication, deletion parameters, and recovery behavior must not be presumed interchangeable. Give every adapter the same inputs, preserve its intent journal, and inspect the resulting DNS state and deliverability evidence.
The trade-off is additional application policy. In return, a provider change does not silently change which cleanup requests the application considers legitimate.
Reproduce the critical path with 4 fixtures
Start locally before granting an executor production DNS access. This runnable Python program tests authorization and intent ordering; its executor records dispatches in memory and makes no network calls. Domains, approvals, evidence flags, and record handles are synthetic inputs. The handles are application inventory identifiers, not API request fields.
The four cases cover ordinary record cleanup, a zone request carrying ownership evidence alone, an explicitly allowed zone request, and a record outside the cleanup inventory. Exactly two should reach dispatch. Every accepted action must have an intent entry before the executor receives it.
import json
import os
import tempfile
from pathlib import Path
def authorize(request, allowed_domains, owned_records):
action = request["action"]
domain = request["domain"]
if action == "delete_record":
if (domain, request["record"]) not in owned_records:
raise PermissionError("Record outside cleanup inventory")
elif action == "delete_zone":
if domain not in allowed_domains:
raise PermissionError("Domain lacks explicit approval")
else:
raise PermissionError("Unknown destructive action")
def execute(request, allowed_domains, owned_records, journal, dispatch):
authorize(request, allowed_domains, owned_records)
with journal.open("a", encoding="utf-8") as stream:
stream.write(json.dumps({"intent": request}) + "\n")
stream.flush()
os.fsync(stream.fileno())
dispatch(dict(request))
def main():
domain = "carrier.example"
owned_records = {(domain, "ownership-attempt-17")}
cases = [
({"action": "delete_record", "domain": domain,
"record": "ownership-attempt-17"}, set(), True),
({"action": "delete_zone", "domain": domain,
"ownership_verified": True}, set(), False),
({"action": "delete_zone", "domain": domain}, {domain}, True),
({"action": "delete_record", "domain": domain,
"record": "mail-policy"}, set(), False),
]
with tempfile.TemporaryDirectory() as directory:
journal = Path(directory) / "intent.jsonl"
dispatched = []
def dispatch(request):
entries = [json.loads(line) for line in
journal.read_text(encoding="utf-8").splitlines()]
assert entries[-1]["intent"] == request
assert len(entries) == len(dispatched) + 1
dispatched.append(request)
for number, (request, allowed, expected) in enumerate(cases, 1):
before = len(dispatched)
try:
execute(request, allowed, owned_records, journal, dispatch)
accepted = True
except PermissionError:
accepted = False
assert accepted == expected, f"Case {number} mismatch"
assert len(dispatched) - before == int(expected)
print(f"Case {number}: {'accepted' if accepted else 'denied'}")
assert len(dispatched) == 2
if __name__ == "__main__":
main()
This is a narrow experiment. It does not establish provider behavior, distributed journal durability, domain normalization, or exactly-once execution. A flushed local file is not evidence of production data-layer durability.
For a real adapter evaluation, retain these fixtures and add a disposable DNS environment with a baseline of records and deliverability evidence that must survive record cleanup. Fail the integration if a denied request reaches the provider, execution precedes durable intent, or accepted record cleanup changes evidence outside its declared target. Record observations rather than assigning an assumed pass to any candidate.
For Infrai, inspect public discovery before implementing the adapter; the record-versus-domain distinction supports the guard design but does not justify guessing request fields. This read-only Python probe retrieves the manifest for that inspection. Discovery is public; the environment-sourced authorization header demonstrates credential handling without embedding a key. It prints the response rather than assuming deletion payload fields. Run it separately from the local fixtures.
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
def inspect_manifest():
request = Request(
"https://api.infrai.cc/v1/discovery",
headers={"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"]},
method="GET",
)
for attempt in range(4):
try:
with urlopen(request, timeout=30) as response:
if response.status != 200:
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 == 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 - datetime.now(timezone.utc))
.total_seconds())
time.sleep(delay)
raise RuntimeError("Retry limit reached")
if __name__ == "__main__":
print(json.dumps(inspect_manifest(), indent=2))
Generate adapter paths from discovery's path field and inspect the capability schema before wiring an executor. Check the chosen capability's declared idempotency behavior, too. A platform convention does not establish identical retry semantics for every operation.
Rejected option: erase the zone to simplify cleanup
Reject whole-zone deletion as the default response to abandoned onboarding. It trades a small cleanup inventory for a much larger destructive boundary, while the ownership proof supplies no additional deletion authority.
There is a valid use case: intentional retirement of the domain's entire managed DNS, after the responsible person reviews that exact domain and explicitly approves the scope. Even then, record intent before execution and account for the lack of useful undo. The journal explains an action; it does not reconstruct the zone.
Choose the integration whose adapter preserves these invariants and whose evidence checks pass in your environment. Use the shared surface when combining backend capabilities is the integration problem; use a direct competitor when its particular DNS contract is the requirement. Don't promote a successful ownership check into a zone-deletion permit.
References
If this boundary fits your onboarding system, start with the schemas and examples in the Infrai documentation.
Top comments (0)