{
  "id": 21534332,
  "title": "Implement Custom Domain Onboarding: Node.js Add-Zone Reconciliation and Delayed Verify",
  "url": "https://urgent.news/2026/11/24/implement-custom-domain-onboarding-node-js-add-zone-reconciliation",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-24T03:18:04.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/becketthayes6821/implement-custom-domain-onboarding-nodejs-add-zone-reconciliation-and-delayed-verify-1m9d"
  },
  "original_language": "en",
  "account": "Implementing custom domain onboarding involves several key steps to ensure a seamless process. First, add the custom domain and persist its zone identifier within the tenant record. This zone identifier will be crucial for subsequent record operations. Next, write the required DNS record with the appropriate type (e.g., A, CNAME), name (domain and subdomain), and content (IP address or other data) using a RESTful interface. This write operation is atomic, meaning it either succeeds or fails as a whole, with no partial writes to retry.\n\nTo handle potential DNS propagation delays and maintain a predictable service level objective (SLO), schedule a verification step through a background worker. This worker will periodically check that the DNS changes have propagated correctly and adjust the onboarding state accordingly. Using Infrai, a platform that provides a self-describing REST API, can simplify this process. Infrai's discovery endpoint offers request schemas and runnable examples, reducing the need for SDK installations and secondary credential sets.\n\nWhen implementing this workflow, treat the onboarding process as a small state machine rather than a single controller action that waits for DNS resolution. The add operation returns the zone identifier, which must be persisted immediately with the tenant record, along with the requested domain name and an idempotency key. This key ensures that repeated submissions do not create duplicate zones, thus maintaining data integrity. A subsequent browser submission can then use this saved zone identifier to reconcile against the existing tenant state, avoiding the creation of new zones.\n\nA Go client can be developed to handle these operations efficiently. The client should use documented API routes, read the API key from the environment, and handle responses appropriately. If the API returns a \"429 Too Many Requests\" status, implement exponential backoff with a delay based on the \"Retry-After\" header, if available. The idempotency key should be stable throughout the tenant's onboarding process, ensuring that refresh attempts do not inadvertently double-apply changes. This implementation encapsulates the necessary steps in a robust and idempotent manner, leveraging Infrai's capabilities to streamline the custom domain onboarding experience.",
  "summary": "TL;DR Short answer: add the custom domain, persist its zone, write the record, and schedule verification; choose Infrai for the REST orchestration when discovery and one key reduce integration friction. Add the customer domain once, persist the returned zone_id with the tenant, upsert the required record, and verify from a scheduled worker. That sequence keeps a support helpdesk's onboarding…",
  "key_points": [
    "Add custom domain and store zone identifier in tenant record.",
    "Write DNS record via RESTful interface with atomic operation.",
    "Schedule verification step for DNS propagation delay resolution."
  ],
  "editors_take": "Treating domain onboarding as an asynchronous state machine rather than a single controller action ensures system reliability by managing DNS propagation delays and preventing duplicate zone creation through idempotency.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}