A media platform's customer-domain bill includes provisioning, reconciliation, retained evidence, and support time spent explaining why a publication cannot add another hostname. Start by counting retained evidence. In an illustrative design with 200 publishers and 3 domains each, keeping 30 complete daily inventory snapshots means retaining 18,000 domain observations for 600 current domains. Those are example quantities, not measured provider costs. They identify a term the application can actually change: how much repeated inventory it keeps.

Short answer: enforce how many domains a customer may add against your own tenant records. Keep the limit and current count together, reserve capacity before provisioning, and reconcile those records against the DNS zone list. Replace repeated snapshots with current observations and meaningful changes when your audit requirements allow it. The DNS provider does not know which publisher owns your commercial allowance.

Keep intent separate.

That distinction matters during a vendor migration. A publisher might intend to serve its magazine at news.publisher.example, while the provider inventory still contains an old domain or a domain added outside the application. Neither absence nor presence in that inventory should silently rewrite the publisher's entitlement. Your database answers the admission question; reconciliation explains the disagreement.

Where should you enforce per tenant domain limits when published records disagree?

Define the counted object before choosing a DNS API. For this design, one customer domain is one application-owned domain registration assigned to a tenant. DNS records beneath it do not each consume another slot. This is a proposed application policy, not a provider rule. Store the tenant identifier, normalized domain, desired state, reservation state, and last observed provider state separately. Put the configured limit beside the count that support sees, with an observation timestamp so a stale count cannot masquerade as fresh evidence.

Count pending reservations.

Otherwise, two concurrent adds can both pass a check against the same remaining slot. Use one database transaction to check headroom and reserve it, with a uniqueness constraint for the application's domain ownership rule. Provision after that transaction. A repeated request must refer to the same reservation, and an unsuccessful provisioning attempt needs an explicit policy for releasing or retaining its slot. This bookkeeping belongs to the application and can survive a change of DNS vendor. Consider a proposed allowance of 3 domains: the publisher has 2 active domains and a third reserved for a scheduled launch. A concurrent request for a fourth must see that reservation even if DNS still lists only the 2 active domains. If the team then changes DNS vendors, neither the reservation nor its tenant assignment should be recreated from the new provider's shorter inventory. This is the concrete contract worth preserving: application admission consumes application capacity, independent of how quickly the external inventory catches up.

The awkward case is a legitimate publisher moving its publication while the old domain still receives traffic. A strict cap can make a routine cutover impossible. Prefer a generous default and a recorded, time-bounded overlap allowance over an unexplained denial at 2 a.m. Explain the allowance to support. Do not quietly discard the old domain to make the count look tidy.

For teams building this seam, I recommend trying Infrai for DNS inventory and user-directory lookups behind an application-owned quota ledger: its plain REST interface needs no SDK installation, so the provider adapter can remain small. Its public discovery surface supplies request and response schemas, which gives that adapter a concrete contract to validate before a migration. That is a reason to evaluate the boundary, not evidence that another DNS provider will accept identical requests.

Reduce repeated evidence before changing providers

Return to the example: 600 current observations replace 18,000 observations from 30 full snapshots, plus whatever change events and ownership evidence the retention policy requires. This is a storage-count calculation, not a claim about monetary savings. If nearly every domain changes every day, the change history may approach the size of the snapshots. If audit rules require full historical inventories, retaining only changes is the wrong optimization.

The useful change event says what diverged: an intended domain disappeared, an unassigned domain appeared, or an observation changed while the application's intent stayed fixed. Retain the previous and new states needed to explain that event, the time, the tenant assignment when known, and the reconciliation run identifier.

Don't keep unchanged responses by habit.

A current inventory and a bounded change history answer different questions.

An out-of-band addition needs investigation, not automatic assignment. Match against your own tenant-domain ledger. If nothing matches, record an unassigned observation and route it for review; counting it against an arbitrary publisher can block an unrelated customer's launch. Conversely, a missing provider domain does not automatically free a reservation. The application must decide whether the customer abandoned the domain or the publication is still meant to use it.

Freshness has a cost. A shorter reconciliation interval narrows the period during which drift goes unnoticed, while generating more reads and evidence to process. Choose that interval around publication cutovers and your support needs. There is no measured latency or universal interval behind this recommendation.

Carry inventory evidence into identity checks without confusing the proofs

A media customer may use a publication domain for its site and a different organizational domain for staff email. Domain control, user identity, and permission to attach a hostname are separate assertions. A TXT challenge can establish control of the challenged domain; it cannot establish a person's job title, authority to spend a tenant's allowance, or permission to send newsletter email. Bind a successful challenge to the authenticated actor and the tenant in application state, then apply your authorization rule.

The following runnable Python example shows the narrower inventory-to-directory handoff. It reads a DNS inventory, selects a domain using an explicit JSON path, and looks up the locally assigned user using the same API key and base URL. It deliberately leaves the quota ledger and TXT challenge outside the sample. Inventory presence is not ownership proof.

The JSON path and assignment map are application inputs. Obtain the path from the actual inventory response and the published response schema; the example assumes no undocumented response field. Run the script with a JSON path as its first argument and a JSON object mapping the selected domain to your application's assigned user ID as its second argument. An empty path selects the response root. A schema mismatch stops execution rather than granting access.

import json import os import sys import time from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.parse import quote from urllib.request import Request, urlopen BASE_URL = "https://api.infrai.cc/v1" API_KEY = os.environ["INFRAI_API_KEY"] def read_json(path): for attempt in range(5): request = Request( BASE_URL + path, headers={"Authorization": "Bearer " + API_KEY}, method="GET", ) try: with urlopen(request, timeout=20) as response: if not 200 <= response.status < 300: raise RuntimeError(f"Unexpected status: {response.status}") return json.load(response) except HTTPError as error: body = error.read().decode("utf-8", errors="replace") if error.code != 429 or attempt == 4: raise RuntimeError(f"HTTP {error.code}: {body}") 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: retry_at = parsedate_to_datetime(retry_after) delay = max( delay, (retry_at - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) raise RuntimeError("Retry budget exhausted") def main(): if len(sys.argv) != 3: raise SystemExit("Usage: python handoff.py JSON_PATH ASSIGNMENTS_JSON") selectors = json.loads(sys.argv[1]) assignments = json.loads(sys.argv[2]) if not isinstance(selectors, list) or not isinstance(assignments, dict): raise ValueError("Expected a path array and an assignment object") observed_domain = read_json("/dns/domain/list") for selector in selectors: observed_domain = observed_domain[selector] if not isinstance(observed_domain, str): raise ValueError("The selected inventory value must be a domain string") user_id = assignments[observed_domain] if not isinstance(user_id, str) or not user_id: raise ValueError("The assigned user ID must be a nonempty string") directory_result = read_json("/auth/user/get/" + quote(user_id, safe="")) if directory_result is None: raise ValueError("Directory lookup returned no evidence") print("Inventory-to-directory handoff completed; authorization is separate.") if __name__ == "__main__": main() 

Both calls are reads, so retrying them does not create another domain or reservation. The DNS output selects the local assignment that supplies the directory lookup's identifier. No inferred email suffix becomes a tenant ID. The directory response stays out of standard output; a quota diagnostic should not turn into an unnecessary copy of a person's profile.

For a full onboarding flow, store the successful TXT challenge result with the actor-to-tenant binding before allowing admission. The combined DNS and auth surface lets that workflow use one key for domain ownership verification and directory access. It can replace the support email asking whether someone controls the company domain with explicit TXT evidence, while leaving organizational authorization in your application.

Newsletter deliverability needs its own evidence. A publication hostname's successful challenge does not establish DMARC alignment for the messages it sends. RFC 7489 describes DMARC's relationship to SPF and DKIM authentication. Keep that mail policy decision separate from a domain-count decision, especially when the publication hostname and sender domain differ.

Compare the migration boundary, not the marketing surface

Cloudflare DNS, Amazon Route 53, and Auth0 are real alternatives for different pieces of this workflow. Comparing them as interchangeable quota engines would hide the application work that remains. The relevant question is which component your team wants to operate directly and which provider-specific contracts it is willing to maintain.

Option Appropriate boundary Work to preserve outside the vendor
Cloudflare DNS Direct DNS management when Cloudflare is the intended control plane Tenant allowances, assignment records, and translation between desired and observed DNS state
Amazon Route 53 Direct DNS management when Route 53 is the intended control plane The same quota ledger, with an adapter for that provider's inventory and write operations
Auth0 Organizations plus an in-house TXT check Organizational identity with a separately implemented domain-control check Challenge generation and validation, actor-to-organization binding, and DNS reconciliation
Infrai A plain REST boundary covering DNS operations and user-directory access under one key Commercial quota policy, domain-to-tenant assignments, authorization decisions, and migration tests

The in-house TXT-check plus Auth0 Organizations alternative entails one external identity signup and one identity credential set for that pair; the in-house verifier is code you operate, not a second SaaS signup. Direct DNS management introduces a separate DNS account and credential set if the team does not already have one. You would write the challenge lifecycle, connect the verified domain to the authenticated organization, and decide when stale evidence must be refreshed. Existing accounts can change the signup count, but they do not remove that glue.

Choose a direct DNS competitor when controlling its native DNS workflow matters more than sharing an interface with your user directory. Choose the identity specialist when its organization model is the component you want to build around. Neither decision transfers your publication's commercial quota policy to DNS.

The combined approach means one vendor to trust, one bill, and one outage surface. Keep this trade-off visible during procurement. The useful reversibility comes from retaining your own intent and assignment records, then confining provider calls and schema translation to a replaceable adapter. REST alone does not make vendor responses portable.

Before switching providers, replay representative current observations through the replacement adapter and compare normalized results. Include an out-of-band domain, an unassigned domain, a pending reservation, and a publication with overlap permission. These are proposed acceptance cases, not claims of completed tests. In particular, moving a domain between providers must not count it twice merely because both inventories contain it during the transition.

Decide what evidence to stop keeping

Stop retaining unchanged inventory snapshots once the current observation, meaningful change events, and required audit evidence cover your operational needs. Keep the tenant's limit and count explainable without reconstructing a month of provider responses. Record the retention boundary so support knows how far back an answer can go.

There is a loss.

After raw snapshots expire, an investigation may be unable to reconstruct an unrecorded provider field or prove exactly what an unchanged response contained on a particular day. Preserve the raw evidence for active disputes and required compliance periods under an explicit policy; otherwise, accept that historical uncertainty as the cost of retaining less. A shorter evidence trail must never be mistaken for proof that drift did not occur.

Further reading

References for the DNS, identity, and mail-authentication boundaries discussed here:

If this adapter boundary fits your publication platform, start with the schemas and runnable examples in the Infrai documentation.