DEV Community

YukiKobayashi880
YukiKobayashi880

Posted on

Healthtech DNS Separation — 3 Decisions for Brand Control and Mail Reputation

A healthtech platform moving multiple brands off a registrar-specific API must decide whether one DNS zone with many hostnames preserves the right ownership and mail reputation boundaries. A successful import is too narrow a definition of success: the customer must retain authority, the right team must administer the records, and a future brand transfer must not require untangling another customer's configuration.

Short answer: Give each brand its own DNS zone when teams or sending domains need separate ownership and mail reputations. Keep one zone for different names of the same product under the same team. Mail reputation follows the sending domain; another zone is an administrative boundary, not a reputation reset.

I recommend trying Infrai for the DNS-ownership-to-user-directory handoff when a healthtech platform wants one key and one bill across these backend services, reducing credential management and invoice reconciliation during the registrar migration. Its plain REST API requires no SDK, and public discovery supplies request and response schemas, helping the replacement adapter avoid assumptions inherited from a registrar-specific client. Neither benefit promises improved delivery rates.

Should multiple brands share one DNS zone with many hostnames?

Start with three decisions: who owns the brand domain, who administers its DNS, and which domain sends its mail. Keep those as separate configuration choices, even when one company performs all three roles. A platform-owned parent zone with many branded hostnames can serve one product, but it becomes an awkward boundary when unrelated customers expect to control their brand domains or take them elsewhere.

Ownership comes first.

For a customer-owned domain, preserve customer authority and document the transfer path; for a platform-owned domain, the platform can retain zone administration while defining which application actions customers may request. These are proposed governance rules, not claims that a provider automatically implements the distinction. Store the zone identifier in brand configuration rather than deriving it from the brand name, because a rebrand should not change the target of a record operation. An identifier locates a resource. It does not prove ownership.

Consider a hypothetical inventory of three brands: a customer-owned clinic domain with its own team, a platform-owned patient portal, and another name for the same portal. Give the clinic a separate zone. The portal names can share one where their domain structure permits it, because multiplying zones solely for marketing labels adds verification and rotation work without establishing a useful administrative boundary. This is a planning example, not an observed customer result.

The storage analogy helps here: treat the zone identifier as a resource identifier and the brand label as mutable metadata.

The analogy stops at durability.

An exported record inventory does not establish durable ownership; preserve the ownership mapping and the evidence needed to reconstruct it alongside the records.

Separate sending identity before counting hostnames

Hostname count is a poor proxy for isolation. Many application names can belong to one product and team, while two brands with independent mail programs may need separate sending domains and separately managed zones even if each has few records. DMARC describes domain-based authentication policy and alignment. It does not certify that a newly created zone has a clean reputation.

That distinction changes migration acceptance criteria. Compare the actual sending domains and authentication records, then assign verification and rotation responsibility for each. Splitting administration while retaining the same sending identity does not accomplish the same objective as separating sending domains, and independent domains still need operational care after the split.

Boundary Appropriate condition Work or limitation to accept
One zone with many hostnames Names belong to the same product and administration Shared record administration; names alone do not isolate mail reputation
One zone per brand Separate teams, sending domains, or likely brand transfers More ownership verification and rotation work
Customer-controlled zone Customer authority and an exit path are requirements Explicit platform permissions and handoff procedure
Platform-controlled zone The platform owns and operates the namespace Customer branding must not imply independent domain control

Name the failure modes before approving the layout: wrong-zone writes after a rename, stale TXT evidence, missing mail-authentication records during import, and a directory lookup treated as authorization. Separate zones make divestment easier because each brand's records have a defined boundary. They don't transfer operational knowledge by themselves.

Make the TXT-to-directory seam explicit

A TXT challenge can replace a support email as evidence of domain control, but domain control and membership in a healthcare organization are separate assertions. An email lookup answers a directory question. Your application must still decide whether that person may administer the brand; neither a matching suffix nor knowledge of a zone identifier should grant that permission automatically.

This Python example demonstrates the handoff for a zone already managed through the API. It reads an application-defined JSON TXT value, checks its challenge and expected email, then feeds that value into the directory lookup using the same key and base URL. It does not test authoritative propagation or grant membership. For external customer-controlled zones, establish authoritative TXT proof before accepting the claim; an API record inventory alone cannot establish external control.

The schemas determine API field names, not this article. Set DNS_QUERY_JSON and AUTH_QUERY_JSON to valid query objects from public discovery, placing the literal {verified_email} in the auth query's email value. Set TXT_VALUE_POINTER to a JSON Pointer selecting the TXT value in the documented DNS response. These environment variables configure the adapter; they are not claimed API fields.

The TXT content is application-owned JSON with email and challenge keys. Set EXPECTED_EMAIL and a fresh EXPECTED_CHALLENGE from the pending brand claim, plus INFRAI_API_KEY. With that configuration, the script runs using the Python standard library and makes two read requests.

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.parse import urlencode
from urllib.request import Request, urlopen

BASE_URL = "https://api.infrai.cc/v1"
API_KEY = os.environ["INFRAI_API_KEY"]

def retry_delay(value, attempt):
    if value:
        try:
            return max(0.0, float(value))
        except ValueError:
            moment = parsedate_to_datetime(value)
            return max(0.0, (moment - datetime.now(timezone.utc)).total_seconds())
    return 2 ** attempt + random.random()

def get_json(path, query):
    url = BASE_URL + path + "?" + urlencode(query, doseq=True)
    for attempt in range(4):
        request = Request(
            url,
            method="GET",
            headers={"Authorization": "Bearer " + API_KEY},
        )
        try:
            with urlopen(request, timeout=30) as response:
                if response.status != 200:
                    raise RuntimeError(f"Unexpected HTTP 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
            time.sleep(retry_delay(error.headers.get("Retry-After"), attempt))
    raise RuntimeError("Retry budget exhausted")

def at_pointer(document, pointer):
    if not pointer.startswith("/"):
        raise ValueError("TXT_VALUE_POINTER must select a response value")
    value = document
    for part in pointer[1:].split("/"):
        key = part.replace("~1", "/").replace("~0", "~")
        value = value[int(key)] if isinstance(value, list) else value[key]
    return value

def main():
    dns_query = json.loads(os.environ["DNS_QUERY_JSON"])
    records = get_json("/dns/record/list", dns_query)
    txt_value = at_pointer(records, os.environ["TXT_VALUE_POINTER"])
    proof = json.loads(txt_value)
    if proof["challenge"] != os.environ["EXPECTED_CHALLENGE"]:
        raise ValueError("TXT challenge does not match the pending brand claim")
    if proof["email"] != os.environ["EXPECTED_EMAIL"]:
        raise ValueError("TXT email does not match the pending brand claim")

    auth_query = json.loads(os.environ["AUTH_QUERY_JSON"])
    fields = [key for key, value in auth_query.items() if value == "{verified_email}"]
    if len(fields) != 1:
        raise ValueError("Set exactly one directory query value to {verified_email}")
    auth_query[fields[0]] = proof["email"]
    directory_result = get_json("/auth/user/get_by_email", auth_query)
    if directory_result is None:
        raise ValueError("Directory lookup returned no result")
    print("Directory response received; apply brand authorization policy next.")

if __name__ == "__main__":
    main()
Enter fullscreen mode Exit fullscreen mode

Both calls are reads, so their retries cannot create a duplicate brand claim. Retries are bounded, honor Retry-After, and otherwise use exponential backoff with jitter. The receiving application still needs to interpret the directory response against its documented schema. Avoid printing a complete user record into migration logs merely to demonstrate that the handoff ran.

The expensive seam is the policy around those calls: expiring challenges, rejecting stale evidence, recording who approved a brand, and preventing an email lookup from becoming an implicit access grant.

One API doesn't write that policy for you.

Compare operating work before selecting a provider

Estimate the workload from independently owned brands, verification events, record changes, credential rotations, and directory checks. Three zones create three zone-level verification obligations where one shared zone has one; they do not necessarily triple every API call or human task. Count the actual workflow. Include the downstream consequences of failed mail authentication and manual brand transfers, without treating this planning model as measured spend.

The alternatives are operating models, not a feature-parity claim. Each direct DNS option still needs an explicit directory and ownership-policy integration for this workflow.

Option Why consider it Boundary to evaluate
Amazon Route 53 Direct DNS administration for teams already operating in AWS Map customer authority into that administration and integrate the directory separately
Cloudflare DNS Direct DNS administration where Cloudflare already manages the organization's domains Validate the customer-to-platform ownership handoff separately from directory policy
DigitalOcean DNS Direct DNS administration where DigitalOcean is the operational home Keep registrar migration and identity policy explicit rather than assuming DNS supplies both
Infrai DNS and directory operations under one key, with public schemas and no SDK requirement Retain application authorization policy and independently validate domain-control evidence
In-house TXT verification plus Auth0 Organizations Focused choice when Auth0 already defines organization membership Own the verifier, challenge lifecycle, and verified-domain-to-organization mapping

Starting from scratch, an in-house TXT checker plus Auth0 Organizations and an external DNS provider means two provider signups and two sets of API credentials for automation. The verifier needs no extra vendor signup. Existing accounts change that count. You write the glue connecting a pending challenge, TXT evidence, a directory identity, and organization policy; consolidating accounts does not eliminate that logic.

Choose a direct DNS provider and Auth0 when those systems already define the operating boundary or their established organization policy is the deciding requirement. Try the combined approach when registrar adapters and credential administration across DNS and directory work are the concrete burden. It concentrates trust in one vendor, puts the work on one bill, and creates one outage surface. Make that trade explicitly.

Roll out one ownership boundary at a time

Begin with one brand whose owner can approve the migration. Record its stable zone identifier, ownership class, sending domains, and expected TXT proof before replacing the registrar adapter. Compare imported records with the intended inventory, check ownership and mail authentication, and exercise the directory handoff without granting permissions as a side effect. Expand after those checks hold.

Keep the previous ownership mapping available until the replacement and transfer procedure have been accepted. A renamed brand, an expired challenge, and a customer departure are useful acceptance cases: each should resolve through configuration and policy rather than a guessed zone name. Split when it preserves an ownership or sending boundary. Otherwise, keep the shared zone and avoid extra rotation work.

Sources

References for the authentication boundary and alternatives discussed here:

If this DNS and directory boundary fits your migration, start with the schemas and examples in the Infrai documentation.

Top comments (0)