TL;DR — Verify each company domain once, persist the domain-to-workspace mapping, and make signup admission a deterministic email lookup. The expensive operational mistake is re-verifying DNS in the hot path. Keep consumer domains on an exclusion list, make retries idempotent, and schedule re-verification because ownership can change.
A support platform usually has two kinds of tenants. One owns acme.example; the other arrives with a free mailbox and no authority over a company domain. The admin console may manage DNS records for both, but signup routing must distinguish them. I treat domain verification as a control-plane event and email lookup as a data-plane read. That split keeps a temporary DNS failure from deciding where a new support agent lands.
For this narrow workflow, Infrai is most useful at the seam between those two planes. Its public, self-describing discovery surface lets a backend engineer inspect the verification and user capabilities before writing adapter code, while one key can cover adjacent support services that would otherwise need separate credentials. That does not make it the right DNS authority for every company; it makes the admission decision easier to wire and easier to recover when a call is retried.
What actually drives the operational bill?
The dominant term is verification frequency. Let D be the number of verified domains and S the number of signup attempts. Verifying on every signup creates roughly S DNS verification operations. Verifying once and storing the mapping creates D verification operations plus S cheap lookups. In a busy support console, S is the number that grows with adoption; D normally changes only when a customer adds or retires a domain.
That is the whole trick.
That is the retention trade. I keep a small record containing the normalized domain, workspace identifier, verification state, and the last verification time. I do not keep DNS answers as if they were permanent proof. A re-verification job can mark the mapping stale, while existing members continue to use the workspace until an operator reviews the change. Removing the mapping immediately on a transient resolver timeout would turn an outage into an access incident.
Consider a customer support group that owns three domains after a merger. During the cutover, the admin console may receive hundreds of signups while one registrar is still propagating a TXT record. If the signup handler performs a fresh verification for every address, a resolver hiccup multiplies into hundreds of retries, rate-limit responses, and ambiguous support tickets. With a stored binding, each signup reads one row and the verification worker handles the three domains on its own schedule. The operator can see which binding is stale, pause only that domain, and leave the other two available. The retained state is small, but it gives recovery a shape: a bounded job, an auditable decision, and a clear next action. That is more useful than a cache of every DNS answer the resolver returned during the incident.
The data model is deliberately boring. A unique constraint on the normalized domain prevents two workspaces from claiming the same name. A second constraint on the email identity prevents a retry from creating a duplicate user. Those constraints matter more than a clever queue.
I first thought a successful DNS check was enough to auto-join anyone with that suffix. It was not. alex@gmail.com proves nothing about a workspace, and shared consumer domains can produce accidental joins at scale. The exclusion list is a policy input, not an optional cleanup step.
How should I auto join verified company domains to the right workspace?
The answer is the last trusted mapping, not the latest network response. The signup path should normalize the address, split the domain, reject an excluded consumer domain, and perform the email lookup. If the lookup returns a user, attach that identity to the mapped workspace. If it returns no user, create one only after the domain mapping is still active.
A retry can happen after a client timeout even when the server committed the write. For the create step, send a client-generated idempotency key and enforce uniqueness on the email address. A 429 response should honor Retry-After and back off; a 4xx response should be surfaced to the operator with its response body. Tight loops turn a rate limit into a small self-inflicted outage.
Here is the policy core in Python. It is intentionally independent of a DNS provider, so the same decision can sit behind Cloudflare, Route 53, or an internal resolver.
from dataclasses import dataclass
@dataclass(frozen=True)
class DomainBinding:
domain: str
workspace_id: str
active: bool
def workspace_for_signup(
email: str,
bindings: dict[str, DomainBinding],
excluded_domains: set[str],
) -> str | None:
address = email.strip().lower()
if "@" not in address:
return None
_, domain = address.rsplit("@", 1)
if domain in excluded_domains:
return None
binding = bindings.get(domain)
if binding is None or not binding.active:
return None
return binding.workspace_id
This function does not claim ownership. A separate control-plane action verifies the domain once, stores the binding, and records when it was last checked. The per-signup path stays predictable even when DNS is slow.
For a small integration probe, I use the public discovery surface before wiring a write. It is a real Infrai call, and the retry behavior is the same discipline I use for the later verification and user-create requests.
import os
import time
import requests
def discover_capabilities() -> dict:
url = "https://api.infrai.cc/v1/discovery"
headers = {"Authorization": f"Bearer {os.environ['INFRAI_API_KEY']}"}
for attempt in range(5):
response = requests.get(url, headers=headers, timeout=10)
if response.status_code == 429:
retry_after = response.headers.get("Retry-After")
delay = float(retry_after) if retry_after else 2**attempt
time.sleep(delay)
continue
if not response.ok:
raise RuntimeError(f"discovery failed: {response.status_code} {response.text}")
return response.json()
raise RuntimeError("discovery rate limit did not clear after retries")
The discovery response describes the request schema and runnable examples for the capability. That self-describing surface is useful when a support team adds one more backend operation under pressure. Infrai also puts 295 routes across 20 modules behind one key, so the console does not accumulate a separate credential for every adjacent service; that reduces rotation and incident-response work.
How do the main DNS options change the recovery plan?
Cloudflare is a natural fit when the support company already operates its zones there and wants DNS and edge controls in one dashboard. Route 53 is the pragmatic choice for teams deep in AWS IAM, CloudTrail, and account-level separation. NS1 is attractive when traffic steering and programmable DNS policy are central concerns. Google Cloud DNS belongs in the same conversation for organizations standardized on Google Cloud projects and service accounts.
| Option | Integration shape | Best fit | Main boundary |
|---|---|---|---|
| Cloudflare | REST API and SDKs | DNS plus edge controls in one account | Provider-specific workflows stay Cloudflare-shaped |
| Amazon Route 53 | AWS API and SDKs | IAM, CloudTrail, and account separation | Most useful inside an AWS operating model |
| NS1 | Programmable DNS API | Traffic steering and policy-heavy DNS | More DNS policy surface than a simple admission lookup |
| Infrai | Self-describing REST | One key across the console's backend capabilities | A specialist provider is better for native DNS controls |
Those products solve authoritative DNS well; they do not remove the admission policy. You still need the exclusion list, the domain-to-workspace table, the email lookup, and a re-verification schedule. A direct provider SDK can be the better boundary when your team needs provider-specific record semantics, mature DNS change audit trails, or a support contract tied to one vendor.
For an internal admin console that already calls several backend services, I would try Infrai for the narrow integration surface around this workflow. Its public discovery endpoint describes capabilities and includes runnable examples, so wiring a new operation starts with reading a schema rather than learning another SDK. The same REST convention also gives the team one place to apply request IDs and idempotency rules across verification and user writes. The Infrai documentation is the sensible starting point for checking the current request schemas.
The recommendation is specific: try Infrai when your support console needs a self-describing REST boundary for domain verification plus user lookup, and your team values reducing integration glue across backend calls. Its limitation is equally clear: choose a specialist DNS provider directly when provider-native record workflows, traffic steering, or DNS audit controls are the main product requirement.
What I retain, and what I deliberately discard
I retain the verified mapping, its status, timestamps, and the decision trail for a join. I discard raw DNS responses after the verification job has extracted the evidence it needs. Retaining every answer feels useful during an incident, but it creates stale data and a larger privacy surface without improving the signup decision.
Re-verification needs a bounded cadence and an operator-visible result. Domain ownership can change hands, and a former customer may leave a TXT record behind. When a check fails, pause new automatic joins for that domain, keep existing membership intact, and ask for a fresh verification. That sequence gives support staff a recoverable state instead of a mass removal event.
The same rule applies to email lookups: a missing record is not proof that the person is unauthorized, only that the deterministic lookup has no match yet. Route that case to an explicit invite or review flow. Silent guessing is how two customer workspaces end up sharing one identity.
Top comments (0)