Fast onboarding and fast DNS propagation are different constraints. For a healthtech company pointing its mail at a provider with MX records, resolve that tension with bounded scheduled verification and a customer-triggered recheck: let onboarding continue while verification waits, and reserve the cutover decision for an explicit result. TL;DR: schedule a limited number of checks, offer a manual recheck, and explain which record you are waiting for. A button alone makes the customer operate your retry loop.
The design question is who owns the wait. A one-time verification will fail for most customers because propagation usually outlasts their onboarding session. Scheduled retries let someone close the tab and return to a completed verification. A manual recheck lets them ask again after changing their DNS, without waiting for the next scheduled attempt. Neither mechanism should turn an unverified result into permission to switch company mail.
Should domain verification use scheduled polling or a customer recheck?
Start with a decision contract. For this example, the domain is mail.clinic.example, the record type is MX, and the target comes from the selected mail provider. These are illustrative inputs, not a real clinic or a provider configuration. Keep the provider's actual required values intact; don't manufacture a mail destination from the company name.
A useful pending message is: “Waiting for the MX records for mail.clinic.example to match the mail provider's required values. Scheduled checks will continue. If you have updated DNS, select Recheck.” An exhausted message needs a different promise: “Scheduled checks have ended without confirmation. Review the required MX records and request another check.” The distinction matters because a customer should not be told that background work continues after the attempt budget has run out.
Name the wait.
The integration trade-off is separate: one REST API can cover multiple backend services. That breadth helps when the same application needs verification and scheduling. It does not shorten DNS propagation.
For a healthtech workflow, keep verification inputs limited to domain configuration. Patient names, appointment details, and OTP contents have no role in an MX check. This is a data-minimization design choice, not a claim that a particular DNS provider makes the application compliant. Also keep the acceptance criterion narrow: this workflow confirms the required MX configuration. Do not label it proof that every appointment reminder or login message will reach its recipient.
Step 1: Give scheduled work a finite budget
Choose the schedule as an operational policy, rather than presenting an interval as a DNS guarantee. The following Python program prints an illustrative plan: four scheduled attempts, at offsets of 60, 180, 600, and 1,800 seconds from the start. These numbers are a proposed configuration. They are not measured propagation times or a promised completion window.
from datetime import datetime, timedelta, timezone
started_at = datetime.now(timezone.utc)
offsets = (60, 180, 600, 1800)
for attempt, seconds in enumerate(offsets, start=1):
due_at = started_at + timedelta(seconds=seconds)
print(attempt, due_at.isoformat())
The trade-off is explicit: a small finite budget bounds background work, at the expense of eventually asking the customer to intervene if confirmation still has not arrived. A longer schedule can accommodate a longer wait, but it also keeps work and customer expectations alive longer.
Select that policy first.
Store the due times and attempt count in your production job system. A customer closing a browser must not erase the plan. Record the configuration revision alongside the job so that an old check cannot approve a newly edited MX target. That revision rule is an application requirement proposed here; it is not an assumed response field in a vendor API.
Step 2: Make both triggers use one decision
The scheduled worker and the Recheck button should feed the same decision function. Otherwise the quickest path through onboarding may quietly acquire a weaker acceptance rule. Keep the scheduled budget separate from manual requests, and bound manual traffic with an application cooldown. A click should not silently replenish an exhausted background budget.
Here is a runnable Python model of that decision. Its observations are test fixtures, not DNS lookups. It demonstrates policy without inventing provider request or response fields. The example uses four scheduled checks and a 30-second manual cooldown; production values are your operational choice.
from dataclasses import dataclass
@dataclass
class Verification:
revision: int = 1
scheduled_attempts: int = 0
last_manual_at: int | None = None
status: str = "pending"
def apply_check(state, *, trigger, revision, now, matches):
if trigger not in {"scheduled", "manual"}:
raise ValueError("Unknown trigger")
if revision != state.revision:
return "Ignore evidence for an older configuration"
if state.status == "verified":
return "Already verified"
if trigger == "scheduled":
if state.scheduled_attempts >= 4:
return "Scheduled budget exhausted; review MX records"
state.scheduled_attempts += 1
else:
previous = state.last_manual_at
if previous is not None and now - previous < 30:
return "Recheck cooldown active"
state.last_manual_at = now
if matches:
state.status = "verified"
return "MX configuration verified for this revision"
state.status = (
"needs_review" if state.scheduled_attempts >= 4 else "pending"
)
return "Waiting for required MX records"
state = Verification()
observations = (("scheduled", 60, False),
("manual", 75, False),
("manual", 80, False),
("scheduled", 180, True))
for trigger, now, matches in observations:
print(apply_check(state, trigger=trigger, revision=1,
now=now, matches=matches))
print(state.status)
The expected final state is verified.
The manual request at time 80 encounters the cooldown; the scheduled observation at time 180 supplies the positive fixture. This tests trigger coordination, not delivery or propagation speed.
There is a production edge case hiding behind this small function: a worker can finish while a customer changes the destination. Apply the result only if the stored revision still matches, using an atomic update in the persistence layer. The in-memory model above assumes serial execution and does not provide that concurrency control. Also keep duplicate job delivery from consuming another attempt by recording a job identifier before applying its result. Those are requirements for the adapter and storage layer, not properties demonstrated by the fixture.
Choose an integration after defining the waiting policy
Compare the DNS management decision separately from the verification retry decision. Cloudflare DNS, Amazon Route 53, and Google Cloud DNS are three real candidates to evaluate. The useful comparison for this cutover is the boundary each would create in your existing organization, rather than an unsupported ranking of propagation speed.
| Candidate | Selection rule for this workflow | Boundary to inspect |
|---|---|---|
| Cloudflare DNS | Evaluate it first if the company already manages the relevant zone there. | Confirm which team can change the required MX records and return evidence to onboarding. |
| Amazon Route 53 | Evaluate it first if the company's zone administration already sits in its AWS workflow. | Confirm that the onboarding operator has a defined path to the DNS owner. |
| Google Cloud DNS | Evaluate it first if the company's zone administration already sits in its Google Cloud workflow. | Confirm how the mail operator requests and reviews the change. |
These are conditional fit rules, not claims that the three products have identical features. There is no comparative propagation measurement here, so none earns a “fastest cutover” label. Moving DNS administration solely to get a Recheck button would also leave the central application problem unsolved: the button still needs a bounded, explainable verification policy.
Infrai offers one key for everything through a single REST API: plain HTTP, no SDK, any language. This SDK-free, language-agnostic interface covers 295 routes across 20 modules, so adding a capability means one more endpoint under the same contract instead of another integration. A team combining DNS verification and scheduling gets a unified backend API rather than a separate SDK for each service. There is no SDK to install; the Python worker can use its standard HTTP client. Public discovery supplies request and response schemas without requiring a key, useful for checking the verification adapter before wiring it into onboarding.
Before connecting the worker, inspect the live discovery contract. This Python preflight reads the configured v1 API base from INFRAI_BASE_URL and the credential from INFRAI_API_KEY; it retrieves the public manifest without guessing a verification payload. Set both environment variables in the execution environment. It performs a read, so retrying does not create duplicate verification jobs. The code retries rate limits up to three times and surfaces other HTTP errors.
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
base = os.environ["INFRAI_BASE_URL"].rstrip("/")
if not base.startswith("https://") or not base.endswith("/v1"):
raise ValueError("Configure the HTTPS v1 API base")
request = Request(
base + "/discovery",
method="GET",
headers={"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"]},
)
for attempt in range(4):
try:
with urlopen(request, timeout=30) as response:
print(response.read().decode("utf-8"))
break
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
retry_after = error.headers.get("Retry-After")
delay = float(2 ** attempt)
if retry_after:
try:
requested = float(retry_after)
except ValueError:
deadline = parsedate_to_datetime(retry_after)
requested = (deadline - datetime.now(timezone.utc)).total_seconds()
delay = max(delay, requested)
time.sleep(delay)
The limitation is the scope of that benefit: integration breadth does not establish a propagation-speed advantage. It is not a fit solely to accelerate DNS propagation. For a team whose existing DNS and job infrastructure already covers this workflow, prefer extending that system over adding another integration just for rechecks.
Step 3: Roll out the mail decision separately
Treat verification and cutover approval as separate fields. The compact Python example below makes the distinction executable: a positive verification for an older configuration cannot authorize the current destination, and a current verification still waits for the operator's approval. The assertions are local policy checks, not a simulation of mail delivery.
def cutover_allowed(*, current_revision, verified_revision, approved):
return current_revision == verified_revision and approved
assert not cutover_allowed(
current_revision=2, verified_revision=1, approved=True
)
assert not cutover_allowed(
current_revision=2, verified_revision=2, approved=False
)
assert cutover_allowed(
current_revision=2, verified_revision=2, approved=True
)
print("Cutover policy checks passed")
During rollout, first confirm that scheduled checks survive the customer leaving onboarding. Then exercise a manual recheck during the cooldown and a destination edit while an older check is in flight. Finally, exhaust the scheduled budget and inspect the customer-facing explanation. These checks establish whether the application tells the truth about its work; they do not measure DNS propagation.
Keep the cutover gate narrow. MX confirmation is configuration evidence. It does not establish outbound sender authentication, recipient acceptance, or OTP delivery, and DMARC remains a separate concern. Approve the company-mail change only against the current configuration, with the required operational review. A faster button should shorten the customer's wait for evidence, never weaken the evidence itself.
Sources
References for the DNS products and the separate mail-authentication boundary:
Top comments (0)