Publishing a tenant subdomain quickly and promising that every resolver sees it immediately are different commitments. TL;DR: reconcile the intended record against authoritative DNS, then measure resolver visibility separately; TTL limits how long an ordinary cached answer remains reusable, but it does not push an update into existing caches. For a B2B SaaS onboarding flow, that distinction belongs in the readiness contract before it becomes a support argument.
Consider a production scenario as a design exercise, rather than an incident report: I would trace a tenant named Acme through three events—its subdomain is requested, a resolver looks it up before publication, and the intended record subsequently appears on the authoritative servers. A later lookup through that resolver can still return the cached negative answer. Retrying the publication operation would address the wrong state.
The record may already be correct.
That is the incident lesson to build into the system: intent, authoritative publication, and a particular client's observation are separate states. A successful write acknowledges only what the writer actually verified. It cannot certify the contents of someone else's cache.
Why aren't DNS changes immediate, and what does TTL really control?
DNS resolution uses caches rather than a universal notification channel. RFC 1034 describes the distributed system and its caching model; RFC 1035 defines the TTL field carried by resource records. In ordinary caching, a resolver can reuse a record until its remaining TTL expires without asking the authoritative server again. The authoritative record may change during that interval.
The clock matters.
As an illustrative timeline, suppose a resolver caches the old address with a TTL of 300 seconds. If the authoritative address changes 60 seconds later, that resolver can ordinarily reuse its cached address for another 240 seconds. Another resolver that queries after publication can obtain the new address immediately. These numbers describe one cache entry, not a measured deployment or a promise about the entire resolution path; the relevant TTL is the value received with the cached answer, and the two resolvers need not have queried at the same time.
Lowering the new record's TTL does not reach backward and shorten the TTL already stored with the old answer. For a planned address change, lower the TTL in advance and allow previously cached answers to age out before relying on the shorter interval. Even then, TTL alone cannot establish a deadline for application readiness: authoritative publication, resolver behavior, and the application's own handling of name resolution remain separate concerns.
New tenant names introduce a less obvious trap. A lookup before creation may cache NXDOMAIN, meaning the name does not exist, or a negative answer indicating that the requested record type is absent. RFC 2308 specifies negative caching and derives the negative TTL from the minimum of the SOA record's TTL and its MINIMUM field when the SOA accompanies the negative response. Setting a short TTL on the newly created address record does not retroactively replace that negative entry.
There is also a deliberate exception to the tidy expiration story. RFC 8767 specifies serving stale DNS data under defined conditions when refreshing the data fails. Treat TTL as the ordinary cache freshness boundary, not an unconditional guarantee that no resolver will ever answer with older data.
Define readiness around evidence, not elapsed time
For tenant onboarding, the useful invariant is that a published status refers to a specific version of intended DNS state and to an authoritative observation matching that version. Resolver observations then describe visibility from named vantage points. Combining those claims into one boolean discards the evidence needed to explain a disagreement.
Keep the desired owner name, type, value, and revision in durable state. Compare the relevant record set against authoritative answers without recursion, checking the answer's authoritative status and accounting for DNS name normalization and record ordering. If the authoritative servers disagree, report publication as pending. If they agree but a recursive resolver returns a negative or old answer, report the observation separately. Neither condition justifies repeatedly writing an identical record set.
This is also where ownership becomes operational. A reconciler should mutate only records assigned to that tenant and should recheck the current revision before declaring success; a worker finishing an earlier revision must not mark a newer request ready.
TTL doesn't solve that race.
Define the SLO accordingly. One indicator can track the proportion of accepted tenant requests whose desired revision becomes authoritatively observable within the team's chosen objective. A second can measure successful lookups through a documented set of recursive resolvers. The second indicator is a sample of those paths, with a stated query type and observation time; it cannot prove worldwide convergence.
Keep the labels honest.
For support, preserve when the request was accepted, which revision was checked, what the authoritative answers contained, and what each resolver observed. Put individual tenant names in access-controlled diagnostic events rather than turning every tenant into a monitoring label. Capacity planning needs counts and latency distributions; an investigation needs the particular name.
Buy or build the publication loop?
The useful comparison concerns who operates publication and how much evidence the application can obtain. A managed control plane still leaves the SaaS team responsible for tenant intent, ownership, and its readiness contract. Operating authoritative DNS adds another service to the on-call rotation; neither arrangement removes recursive caching.
| Approach | Responsibility retained by the SaaS team | Boundary to test |
|---|---|---|
| Managed publication with an application reconciler | Intent storage, revisions, retries, authoritative checks | Does an accepted change become observable on the authoritative servers? |
| Self-operated authoritative service with a reconciler | The same application duties plus authoritative service capacity and availability | Can publication and query serving meet their objectives during maintenance and failures? |
| A wildcard record for tenant subdomains | Tenant admission and routing at the application boundary | Does shared DNS behavior fit the required per-tenant routing and isolation model? |
A wildcard can reduce per-tenant record creation when tenants share a destination, but RFC 4592's synthesis rules depend on which names exist in the zone. It isn't a substitute for checking whether a tenant is authorized at the application boundary. Tenant-specific destinations or record-level lifecycle requirements can make explicit records the clearer choice.
The trade-off is on-call work, control, and the ability to retrieve and audit state. Evaluate recurring operating effort and switching constraints alongside service cost. A publication service whose acknowledgement semantics are unclear creates work for the readiness model regardless of its price.
Make the preventative path version-aware
The following Go fragment expresses a status gate, not a DNS client. Its caller supplies authoritative observations for one snapshot and performs the revision check and status update atomically in durable storage. Keeping that transaction outside the function makes the concurrency requirement explicit without pretending an in-memory comparison prevents a distributed race.
package readiness type Observation struct { Revision uint64 Authoritative bool MatchesIntent bool } func CanMarkPublished(currentRevision uint64, observations []Observation) bool { if len(observations) == 0 { return false } for _, observed := range observations { if observed.Revision != currentRevision || !observed.Authoritative || !observed.MatchesIntent { return false } } return true } The caller must obtain the expected authoritative observations before evaluating this gate; a nonempty slice does not establish that every required server was checked. Timeouts, missing observations, and unparsable answers leave publication pending. A matching answer from a recursive cache never substitutes for an authoritative observation.
Test the state transitions that can lie to an operator: revision 7 completes after revision 8 is requested; one required authoritative server still returns the previous value; a resolver retains a negative answer after publication; and a probe fails while the desired record is already present. These are proposed test cases, not reported incidents. Their expected outcomes should differ: stale work cannot certify the current revision, incomplete publication stays pending, cached disagreement affects visibility, and probe failure preserves uncertainty.
Deploy changes to the reconciler with bounded concurrency and retry backoff. Estimate probe demand as pending tenant operations multiplied by observation targets and polling frequency, then add retries and ordinary DNS traffic separately. Otherwise a burst of signups can turn an innocent readiness check into an unplanned query workload. Rewriting records on every failed lookup spends control-plane capacity without invalidating the cache that caused the lookup to fail.
Where this lesson stops
This model addresses drift between tenant intent and published DNS records. It doesn't establish that the resulting destination serves the tenant correctly: name resolution, connection establishment, certificate validation, and application routing require their own checks. A successful DNS answer is one readiness dependency.
For a planned migration of an existing tenant, retain the previous destination for an overlap interval chosen from the actual caching and client assumptions, with an explicit rollback plan. For onboarding behind an existing wildcard, publication may already be complete and application admission becomes the changing state. The governing rule stays small: make each status claim match the evidence collected, and explain DNS delay through the cache that still holds an earlier answer.
References
The standards below describe the caching and wildcard mechanisms discussed above.
Sources
- RFC 1034, domain concepts, resolution, and caching: https://datatracker.ietf.org/doc/html/rfc1034
- RFC 1035, resource records and TTL representation: https://datatracker.ietf.org/doc/html/rfc1035
- RFC 2308, negative caching and SOA-based negative TTL: https://datatracker.ietf.org/doc/html/rfc2308
- RFC 8767, serving stale DNS data: https://datatracker.ietf.org/doc/html/rfc8767
- RFC 4592, wildcard synthesis rules: https://datatracker.ietf.org/doc/html/rfc4592

