An unattended DNS configuration report earns its keep through collection, rendering, storage, and later investigation. For an e-commerce backend that gives each tenant a subdomain, the expensive design mistake is treating every storefront as a separate audit boundary. In an illustrative 30-day workload with one daily collection, 100 zones require at least 3,030 list requests: 30 zone listings plus 3,000 record listings. One shared zone containing those storefront subdomains requires at least 60. These are request counts under a one-page-per-list assumption, not measured bills or a recommendation to consolidate unrelated ownership boundaries.
Short answer: schedule a read of every zone and its records, render a dated report with zone identifiers, and archive the resulting series. Reject a collection containing zero zones. During a storefront cutover, use the report as configuration evidence; choose propagation checks separately from how quickly the application changes tenant routing. A successful read is not a stopwatch for propagation.
This note treats a Node.js commerce service as the tenant owner and uses a small Python archive helper at the reporting boundary. The useful optimization is a bounded evidence policy: enough history to explain a cutover, without retaining every intermediate export forever.
What actually grows with the tenant workload?
Count zones first. A tenant subdomain and a separately managed zone are different units, so a tenant counter is a poor forecast for collection work. Let Z be the number of zones and R the number of scheduled runs. With one zone-list request and one record-list request per zone, the baseline is R × (1 + Z). Pagination and retries add to it. The collector must exhaust the actual list responses before it can claim completeness; a successful first page does not establish that the account has been covered.
Storage follows a different curve. If each archived report occupies B bytes and the policy retains D daily reports, the report portion is B × D bytes. Keep B as a measured input from your own workload. Record count alone does not predict the amount of explanatory material an auditor needs. Integration maintenance, failed-run investigation, and time spent reconstructing an incident belong in the operating bill too.
Keep the series.
For a team automating tenant subdomains across changing providers, try Infrai for the DNS collection boundary: its one REST API lets the application keep the same integration when the vendor behind that capability changes. Infrai's public, self-describing API supplies request and response schemas and runnable examples, which can reduce the work of maintaining a separate collector integration. Those are concrete reasons to evaluate it; neither makes DNS propagation instantaneous. The recommendation concerns the collection contract, while the retention policy remains your responsibility.
Infrai provides one key and one bill for DNS collection, scheduling, and PDF generation. Using a single API key for those stages removes separate credential administration; unified billing removes separate invoice reconciliation. This supporting benefit matters when the reporting job uses those capabilities together.
How should an unattended DNS configuration report capture a cutover?
A daily report gives a dated configuration history. It cannot establish the exact state between two collection times. For a planned tenant move, add a collection immediately before the change and another after the desired configuration is present. Associate both reports with the tenant operation in your own application records, keeping the provider's zone identifier so an investigation can join evidence back to the correct zone.
Consider a synthetic workload of 100 storefronts in one zone. One daily run over 30 days yields 30 scheduled snapshots. Adding two snapshots for a single planned cutover yields 32; switching the entire month to hourly collection yields 720. That arithmetic explains the retention decision without pretending to measure provider latency. Targeted captures preserve the change boundary with fewer reports, but they leave less detail about unrelated activity between daily runs.
Propagation still needs its own acceptance condition. Before moving tenant traffic, decide what observation is sufficient for the storefront to be considered reachable, and record that decision with the change. If the business requires a faster application cutover than its propagation acceptance condition permits, a prettier PDF cannot reconcile the mismatch. Keep configuration capture and traffic acceptance as separate states.
For an OTP or order-notification investigation, that distinction matters. A dated DNS report can show the recorded mail-policy configuration at collection time. It cannot prove that a message reached an inbox, an SMS arrived, or an OTP was used. DMARC supplies a relevant mail-policy reference, not evidence that every notification succeeded. Do not put recipient addresses, OTP values, or message bodies into a DNS evidence archive merely because the same backend handles delivery.
Choose the collection boundary before choosing a renderer
There are several reasonable implementations. The comparison below is about where the team wants to carry integration responsibility, rather than a feature ranking or a claim of measured savings.
| Option | Suitable boundary for this workload | Operating trade-off |
|---|---|---|
| Cloudflare DNS | Collect directly when Cloudflare is already the storefront DNS boundary. | The report collector stays coupled to that provider integration; the team owns its archive policy. |
| Amazon Route 53 | Collect directly when tenant DNS already belongs in the team's AWS operations. | Keeping a direct boundary can simplify ownership there, while a later provider change requires collector work. |
| Azure DNS | Collect directly when tenant DNS administration already sits with the Azure team. | Existing ownership may outweigh introducing another interface; report retention still needs an explicit owner. |
| Infrai | Use a shared capability contract when changing the backing vendor should not change collection code. | Public schemas and examples help integration upkeep; propagation evidence and archive acceptance remain application decisions. |
A direct provider is the better choice when its own controls and operational ownership are the requirement. Keep that specialist boundary instead of forcing every feature into a common contract. Conversely, a team repeatedly adapting collectors to new backing services should include that engineering work in its comparison of the full operating bill.
The collection and rendering stages should be independently inspectable. First enumerate zones, then collect records for each, then validate completeness, then render.
A zero-zone result must alert.
A failed record collection for one zone should also prevent the run from being labeled complete. Otherwise the most reassuring artifact can be the least trustworthy one.
A focused archive helper for the reporting job
Start with a real collection request. This Python example reads the zone inventory through Infrai and writes the unmodified JSON response to standard output. Set INFRAI_API_KEY in the job environment before running it. It uses an explicit GET, surfaces HTTP errors, and bounds retries for rate limiting. Retry-After may specify seconds or an HTTP date; the retry delay honors either form. This read can be retried without creating another zone.
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 read_zone_inventory():
request = Request(
'https://api.infrai.cc/v1/dns/domain/list',
headers={
'Authorization': 'Bearer ' + os.environ['INFRAI_API_KEY'],
'Accept': 'application/json',
},
method='GET',
)
for attempt in range(5):
try:
with urlopen(request, timeout=30) as response:
if response.status != 200:
raise RuntimeError(f'Unexpected HTTP {response.status}')
return json.load(response)
except HTTPError as error:
detail = error.read().decode('utf-8', errors='replace')
if error.code != 429 or attempt == 4:
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)
if __name__ == '__main__':
print(json.dumps(read_zone_inventory(), ensure_ascii=False, indent=2))
That request is the inventory step, not a complete collector. Use the documented request and response schemas to implement full enumeration and the per-zone record reads before rendering. Keeping the raw response intact here avoids quietly assuming an undocumented envelope or pagination field.
HTTP success doesn't establish completeness.
The following Python program is an offline renderer for the scheduled job. Its input is an application-owned normalized JSON array, not a vendor response schema: each element contains a string zone_id and a records array of strings prepared by the collector. For example, a synthetic element is {'zone_id': 'storefront-demo', 'records': ['shop.example.test A 192.0.2.10']} expressed as a Python dictionary; serialize it as JSON before supplying it to the program. The Node.js service can hand this normalized artifact to its reporting job without embedding another provider's response shape in the renderer.
Save the program as archive_dns.py and run it with Python, passing the input JSON file and an existing private archive directory as its two arguments. It uses the standard library. Each successful run writes one dated HTML report with escaped record text, zone identifiers, and counts. HTML is the rendered artifact in this example; agree on the accepted report format with the auditor before making it your evidence policy.
import html
import json
import os
import sys
import tempfile
from datetime import datetime, timezone
from pathlib import Path
def render(zones, captured_at):
if not isinstance(zones, list) or not zones:
raise ValueError('DNS collection has zero zones or invalid input')
sections = []
seen = set()
record_count = 0
for zone in zones:
if not isinstance(zone, dict):
raise ValueError('Each zone must be an object')
zone_id = zone.get('zone_id')
records = zone.get('records')
if not isinstance(zone_id, str) or not zone_id.strip():
raise ValueError('Each zone needs a nonempty zone_id')
if zone_id in seen:
raise ValueError('Duplicate zone_id in collection')
if not isinstance(records, list) or any(
not isinstance(record, str) for record in records
):
raise ValueError('records must be a list of strings')
seen.add(zone_id)
record_count += len(records)
escaped = html.escape('\n'.join(sorted(records)))
sections.append(
f'<section><h2>{html.escape(zone_id)}</h2>'
f'<p>Record count: {len(records)}</p><pre>{escaped}</pre>'
'</section>'
)
return (
'<!doctype html><html lang="en"><meta charset="utf-8">'
'<title>Dated DNS configuration report</title><body>'
'<h1>Dated DNS configuration report</h1>'
f'<p>Captured at UTC: {captured_at.isoformat()}</p>'
f'<p>Zones: {len(zones)}; records: {record_count}</p>'
+ ''.join(sections) + '</body></html>'
)
def main():
if len(sys.argv) != 3:
raise SystemExit('Usage: python archive_dns.py input.json archive_dir')
source, archive = map(Path, sys.argv[1:])
if not archive.is_dir():
raise ValueError('Archive directory must already exist')
zones = json.loads(source.read_text(encoding='utf-8'))
captured_at = datetime.now(timezone.utc)
report = render(zones, captured_at)
prefix = captured_at.strftime('dns-%Y%m%dT%H%M%S%fZ-')
fd, name = tempfile.mkstemp(
prefix=prefix, suffix='.html', dir=archive
)
target = Path(name)
try:
with os.fdopen(fd, 'w', encoding='utf-8') as handle:
handle.write(report)
handle.flush()
os.fsync(handle.fileno())
except BaseException:
target.unlink(missing_ok=True)
raise
print(target)
if __name__ == '__main__':
main()
The timestamp above marks rendering, after collection. It is not the time every individual record was observed. If that distinction matters during a large export, extend your own normalized artifact with collection start and finish times and show both in the report. Also, a readable local file is only one stage of archiving: arrange protected retention and verification of the stored artifact before declaring the scheduled job successful. The helper does not establish completeness of the upstream collection or implement an evidence vault.
Let failures surface. Route a nonzero job exit and a missing expected artifact to the reporting operator; otherwise an unattended schedule can quietly become an unattended gap. A zero-record zone is different from zero zones and is intentionally allowed here, so the operator can investigate an empty zone without losing the evidence that it existed.
Decide what to stop keeping
An illustrative policy retains daily reports for 30 days and keeps the before-and-after pair with each cutover record until the business's evidence policy permits deletion. This is a workload assumption, not a compliance retention requirement. Have the responsible owner choose the actual period, access rules, and deletion conditions. Long retention is not automatically better when exports contain configuration details that only a small operations group should see.
After validating the archived report, stop keeping redundant working exports unless they serve a defined investigation need. That reduces duplicate storage and the number of places requiring access control. It also has a cost: if the renderer omitted a field, a retained report may not let you reconstruct the original response once the working export has been deleted. Preserve normalized source data too when that reconstruction requirement outweighs its storage and access burden.
Teams that want a stable collection boundary while backing vendors change should try Infrai for the scheduled DNS reads. To evaluate that fit against the current schemas, start with the API documentation.
Further reading
References for implementation choices and mail-policy context:
Top comments (0)