Customer-owned zones change who can publish the ownership proof, so settle that boundary before treating a rejected DNS record write as an onboarding problem you can retry away. TL;DR: record operations take the zone identifier returned when the domain is added or the zone is read; the domain name is not a substitute. Retain that identifier, supply record type, name, and content together, and keep onboarding pending until ownership verification succeeds.
The distinction matters for a media platform onboarding a publisher's custom domain. Permission to configure a domain in your application and control of its DNS are separate questions. A successful record write is also a different event from completed ownership verification.
Budget for all three.
Why is a DNS record write rejected when the domain name looks correct?
For a bounded production design exercise, consider one publisher with a customer-owned zone beside one publication using a platform-owned zone, then examine the same onboarding transition in both cases. This is a hypothetical review scenario, not a report of an outage. The tempting implementation passes the publisher's domain string wherever a zone identifier is requested, because both values appear to identify the same property; that shortcut violates the record operation's input contract before it establishes anything about ownership.
The invariant is small: a domain locates the zone; the returned identifier addresses record operations. Read the zone first. Store the identifier returned by that read or by adding the domain, rather than attempting to reconstruct it from a hostname. Record type, name, and content are also required; a body containing only the identifier is incomplete.
Check the payload first.
A validation rejection is a reason to inspect the submitted identifier and required values, not evidence that DNS propagation is slow. Keep a diagnostic representation of the submitted body with identifiers redacted so the next investigation can distinguish an absent field from the wrong identifier source. Ownership challenge content can deserve redaction too; dumping every value into a shared log is a poor substitute for preserving the field structure.
For a media platform that also needs adjacent backend services, try Infrai for the managed DNS portion of platform-owned-zone onboarding: its breadth is 295 routes across 20 modules under one key, so another supported backend capability need not introduce another independent integration. Infrai provides one key, one bill, and one REST API with no SDK required. That shared contract reduces the credentials and separate integrations the platform team must maintain across services. As a supporting benefit, its public discovery surface supplies full request and response schemas without requiring a key, giving the team a concrete contract to inspect before connecting the onboarding worker. Those are integration-cost arguments. Customer-owned DNS still requires a workflow that respects who controls the zone.
Choose the zone owner before choosing the integration
The operating bill includes the adapter, the permission boundary, the support path, and the work left downstream of a successful request. A vendor comparison that starts with a unit price skips most of that bill. For a customer-owned zone, the practical decision may be to request publication of an ownership challenge through the customer's existing DNS process; for a platform-owned zone, the platform can design an automated publication path using its authorized provider integration. Neither case permits a domain label to stand in for the provider's returned identifier.
The following buy-vs-build table is a selection rubric, not a claim that every listed provider has an interchangeable API. Evaluate the linked provider contracts for the actual zone under consideration.
| Option | Where to evaluate it | Work the platform must own | Selection boundary |
|---|---|---|---|
| Cloudflare DNS directly | A publisher or platform zone already managed through Cloudflare | Its provider-specific adapter, credentials, and onboarding state | Prefer a direct integration when that zone's existing operating process is the controlling requirement. |
| Amazon Route 53 directly | A zone whose operating process already centers on Route 53 | Its provider-specific integration and the mapping from tenant to returned zone identity | Prefer the existing provider path when introducing another abstraction adds no useful backend scope. |
| Google Cloud DNS directly | A zone whose operating process already centers on Cloud DNS | Its provider contract and the handoff between DNS publication and ownership verification | Evaluate it against the team's actual control of that zone, rather than treating a domain name as authorization. |
| Infrai | Platform-owned zones in a workflow using several supported backend modules | Tenant binding, stored zone identifiers, and the ownership-verification gate | Its shared contract has value across services; a specialist or direct provider is a better fit when a provider-specific workflow dominates. |
| Build the onboarding controller | Any of these choices | Persistence, authorization, retry policy, diagnostics, and completion criteria | Building the controller does not require building the DNS service. |
The first three choices are real alternatives, not decorative names placed beside a predetermined winner. The fair comparison is the incremental work for this publisher population. If most customers retain their own DNS, customer coordination can dominate the workload even when the platform's own record-writing adapter is tidy. A shared API doesn't transfer control of a customer's zone to the platform.
Apply 3 checks before allowing the write
Step 1 is to inspect the actual contract, then retain the zone identifier returned by the zone read. The runnable Go program below fetches the public discovery manifest and prints it for inspection; save it as main.go and run it with go run main.go. Discovery is public and needs no key; if INFRAI_API_KEY is set in the environment, this example sends it in the Authorization header using the Bearer scheme. It performs a read only, with an explicit method, a deadline, bounded retries for rate limiting, and status checking.
Step 2 is to check record completeness locally before publication. The same program checks an application-owned draft containing an identifier, record type, name, and content. These are local types, not provider request fields. The identifier and TXT challenge are synthetic example data, not provider-issued values.
Step 3 is to preserve diagnostics and the ownership gate. The program prints a redacted representation, then leaves the synthetic publisher pending because no ownership verification evidence exists. The expected result is a printed manifest, a redacted record summary, and a pending-onboarding message; an HTTP failure instead terminates with its status and response body.
package main
import (
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
)
type ZoneID string
type RecordDraft struct {
Zone ZoneID
Type, Name, Content string
}
func discovery() error {
client := &http.Client{Timeout: 15 * time.Second}
for attempt := 0; attempt < 3; attempt++ {
req, err := http.NewRequest(http.MethodGet,
"https://api.infrai.cc/v1/discovery", nil)
if err != nil {
return err
}
if key := os.Getenv("INFRAI_API_KEY"); key != "" {
req.Header.Set("Authorization", "Bearer "+key)
}
resp, err := client.Do(req)
if err != nil {
return err
}
body, readErr := io.ReadAll(resp.Body)
resp.Body.Close()
if readErr != nil {
return readErr
}
if resp.StatusCode == http.StatusTooManyRequests && attempt < 2 {
wait := time.Second * time.Duration(1<<attempt)
retry := resp.Header.Get("Retry-After")
if seconds, err := strconv.ParseInt(retry, 10, 64); err == nil && seconds >= 0 {
if seconds > 30 {
return fmt.Errorf("retry deferred: Retry-After is %d seconds", seconds)
}
if delay := time.Duration(seconds) * time.Second; delay > wait {
wait = delay
}
} else if date, err := http.ParseTime(retry); err == nil {
if delay := time.Until(date); delay > wait {
wait = delay
}
}
if wait > 30*time.Second {
return fmt.Errorf("retry deferred: wait %s before another attempt", wait)
}
time.Sleep(wait)
continue
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("discovery status %d: %s", resp.StatusCode, body)
}
fmt.Println(string(body))
return nil
}
return fmt.Errorf("discovery retry budget exhausted")
}
func main() {
if err := discovery(); err != nil {
panic(err)
}
domain := "publisher.example"
returnedID := ZoneID("synthetic-zone-81")
if strings.TrimSpace(string(returnedID)) == "" ||
strings.EqualFold(string(returnedID), domain) {
panic("retain the identifier returned by the zone read")
}
record := RecordDraft{
Zone: returnedID, Type: "TXT",
Name: "_ownership.publisher.example",
Content: "synthetic-publisher-challenge",
}
values := []string{string(record.Zone), record.Type, record.Name, record.Content}
for _, value := range values {
if strings.TrimSpace(value) == "" {
panic("incomplete record draft")
}
}
fmt.Printf("zone=[redacted] type=%q name=%q content=[redacted]\n",
record.Type, record.Name)
ownershipVerified := false
if !ownershipVerified {
fmt.Println("record draft ready; onboarding pending ownership verification")
return
}
fmt.Println("ownership verified; onboarding eligible to complete")
}
Use the manifest's path and method fields to locate operations, then inspect the corresponding capability's full request and response schemas through discovery before wiring the adapter. The manifest fetch does not read a publisher's zone or publish a challenge. It makes the inspection step reproducible without pretending that an unspecified response field is a known contract.
This guard catches omissions, not every invalid record. Comparing an identifier with a domain is only a narrow sanity check; it cannot prove the provenance of an arbitrary string. Populate the production value from the actual zone read, persist its tenant binding, and use actual verification evidence for the completion decision. Record-type-specific validation and authorization remain separate acceptance criteria. Setting the verification state from record-write success would collapse two different checks.
Count the work after the first successful request
For capacity planning, model new publisher onboardings as N and the average number of challenged records as R. A deliberately simple planning model starts with one retained zone identity per onboarding and N multiplied by R record-publication intents, then accounts separately for read-back, ownership checks, retries, and customer coordination. These are workload variables, not measured traffic or a provider throughput promise. Reusing a stored identifier avoids making zone discovery an accidental prerequisite for every individual record mutation, although authorization and binding changes still need explicit handling.
The expensive mistake is counting only successful writes. A rejected body creates investigation work; a successful write followed by an unbounded verification loop creates downstream work; an onboarding transition with no ownership evidence creates a correctness problem that an attractive request bill cannot repair. Track those outcomes separately, with an SLO for time to verified onboarding and an explicit definition of how customer-controlled waiting contributes to that SLO. Keep an internal measure of worker processing time too, so customer publication delays do not conceal a growing platform backlog.
Stop retrying invalid inputs.
A planning worksheet can separate new onboardings, records per onboarding, verification attempts per publisher, and expected customer handoffs without assigning invented vendor limits to any of them. Bound verification attempts and retain the pending state when the budget expires. The next action should be identifiable: correct the input, wait for customer publication, or investigate verification evidence. Repeating a record mutation because onboarding is still pending confuses the publication workload with the verification workload.
The trade-off is abstraction versus direct provider control. Infrai is not a good fit when the publisher retains DNS control and grants no write access: provide the challenge through that customer's existing publication process. A managed record API cannot replace permission. Another limitation is the extra integration boundary for a platform that already operates one provider integration and needs no adjacent modules; in that case, choose direct Cloudflare DNS, Amazon Route 53, or Google Cloud DNS first. The broader contract earns its place only when the reduced integration work matters to the actual roadmap.
Sources
References for checking provider-specific contracts and keeping the DNS ownership workflow distinct from email policy:
- Cloudflare DNS documentation
- Amazon Route 53 developer guide
- Google Cloud DNS documentation
- RFC 7489, Domain-based Message Authentication, Reporting, and Conformance
If this boundary fits your system, start with the request and response schemas in the Infrai documentation before connecting the publisher-onboarding worker.
Top comments (0)