CustomDomain Docs
Serve

Domain maintenance

Look after your users' DNS with their consent.

Domain maintenance lets your platform keep your users' domains working for them. Each user is asked once, in the widget, when they connect a domain. If they say yes, one setting changes at the company they bought the domain from. From then on, CustomDomain™ (or your own DNS account) runs the domain's DNS. Every record your platform needs is written and kept correct, and the certificate renews. Problems are fixed without asking the user again. The domain stays registered where it is, and its website and email keep working.

The technical name is nameserver migration, because the one setting that changes is the domain's nameservers. The API, the webhooks and the MCP tools use that name (nameserver_migration, nameservers.*), and so does this page where it describes them.

This page is for the engineer who turns it on. It is also for anyone who answers a user's questions about it. What changes for your users is at the end.

DNS, the registrar and nameservers

Three words come up everywhere here. In plain terms:

  • DNS is the internet's address book. It tells browsers and email where a domain's website and mail live. A domain's DNS settings are called its records.
  • The registrar is the company a domain was bought from and is renewed with, like GoDaddy or Namecheap. It is often not the company that runs the domain's DNS: a domain bought at GoDaddy can have its DNS at Cloudflare.
  • Nameservers are one setting at the registrar. They say who runs the domain's DNS. Changing them is the only change a move makes.

So a domain has two parts. One is where it is registered (paid for), which a move never touches. The other is what keeps it working (its DNS), which a move hands to you.

Behind those two parts are three parties:

PartyWhat it doesChanges in a move?
RegistrarWhere the domain is registered and renewed (GoDaddy, Namecheap and so on). It tells the registry which nameservers answer for the domain.No
NameserversThe servers the registry lists for the domain. Every DNS question about the domain goes to them.Yes
DNS hostWhoever runs those nameservers and keeps the domain's records (A, MX, TXT and the rest).Yes

Moving the nameservers changes who answers for the domain: the registry stops listing the old DNS host's nameservers and lists the new ones. The registrar, the registration, the renewal date and the owner stay exactly as they were.

What the user gets:

  • One change, made once. After it, every record your platform needs is written for them, and records that drift are put back.
  • Their website and email keep working. We copy the domain's records to the new DNS host before the nameservers move. The copy counts the mail records (MX, SPF, DKIM, DMARC), so the screen can say "email included". Nothing changes at the registrar until the copy is in place. A copy we could only read from outside waits for a person to check it (The copy).
  • They can switch back, two ways. They can go back to the nameservers they had, while their previous DNS host still answers for the domain. Cloudflare deletes a moved domain's records after 7 days. Or they can go to their registrar's own DNS, which is always there. See What moving back does.

Where the nameservers are changed: at the registrar

A domain's nameservers are changed at its registrar, which is often not the company that runs its DNS. Registered at GoDaddy with its DNS at Cloudflare is the most common split, and then the change is made at GoDaddy. So for every move, We may look up the registrar:

  1. In public registration data. We may look up where a domain is managed. The answer names the registrar, its website and, when one is shown, the reseller it was bought through.
  2. Matched to a provider we connect to. GoDaddy's registrar is GoDaddy, Namecheap's is Namecheap, and so on. We name a registrar we do not connect to, such as a wholesale registrar that sells through resellers. We name the reseller when one is shown. The person then makes the change there.
  3. Used for every way of making the change. A registrar key, a connected account, a secure sign-in and the manual instructions all go to that registrar. An account at the DNS host is never used for the change. A key or account at a company other than the registrar is refused (422 registrar_mismatch). Without an account linked to the connection, we use a connected account of the workspace at the registrar that can read the domain's registration. That applies to a move your server or the console starts.

When the registrar is not known, the move names no company. The next step says to make the change "where acme.com is registered (the company it was bought from)". A connected account at the DNS host is used then only when it can read the domain's registration. That shows it is the registrar's. The move carries the registrar as registrar (name, provider, iana_id, url and source), or null when it is not known. It carries the DNS host the domain left as old_dns_host.

Cloudflare Registrar requires Cloudflare's own nameservers, so a domain registered there cannot be moved without transferring it to another registrar first. The domain check says available: false with reason: registrar_locks_nameservers, and a move is refused with 422 registrar_locks_nameservers before anything is copied.

Who runs it: CustomDomain™ or your own account

Each application picks who runs the DNS of the domains it maintains. The console calls this Who runs it; the API calls it the target.

Who runs ittargetWhere the domain's DNS livesChoose it when
CustomDomain™ (recommended, the default){"kind": "managed"}CustomDomain™'s managed DNSYou want records kept correct and monitored, changes that take effect at once and automatic certificates, with nothing to run.
Your own account{"kind": "dns_host", "account_id": "pacct_…"}Your own account at Cloudflare, Amazon Route 53, Google Cloud DNS or Azure DNSYou keep DNS in your own infrastructure and want us to add each user's domain to it, copy the records and make the change.
Your own nameservers (under Advanced){"kind": "custom", "nameservers": ["ns1.you.net", "ns2.you.net"]}Your own nameserversYou run DNS yourself, on your own servers or a host we do not connect to. You set up each domain; we make the change.

CustomDomain™ uses managed DNS, which is rolling out gradually, so the domain check says per domain whether it can be offered (below).

What your own account needs

First, connect the account as a provider account of the workspace. Give it continuous access and scope all. It creates a zone for every customer's domain, and no list names those in advance. Use a key that may create zones. A zone is one domain's set of records at a DNS host:

DNS hostWhat the key needsNotes
CloudflareA token that may create zonesA token that reaches several Cloudflare accounts also needs the account named. Each zone gets its own nameserver pair, and records are written DNS only (not proxied).
Amazon Route 53An IAM access key that may create hosted zonesA hosted zone of that name already in the account is used. The Route 53 access role is scoped to one zone and cannot create zones, so it does not fit here.
Google Cloud DNSA project ID and an access tokenAn access token expires after about an hour, so a move started later cannot create its zone until the account is connected again.
Azure DNSA subscription, a resource group and an access tokenThe same hour long token. A zone is never overwritten: one that already exists is used.

In the console, Your own account shows a tile for each of these hosts. You can pick a host you have connected, and choose an account when there are several. A host you have not connected is a link to connect it. One connected with a key that cannot create zones says so.

Each zone is found or created, never made twice. A retry uses the zone it already made. A zone that already existed in your account keeps what it holds. Only the connection's own records are written into it, and nothing is deleted.

Your own nameservers

In the console, open Advanced under Your own account and tick Use your own nameservers instead. List them one per line, 2 to 13 nameserver host names. The zone must answer on them before the nameservers move. A move to your nameservers waits in pending until you say the zone is ready (zone_ready: true). Then it checks that your nameservers answer for the domain. skip_zone_check: true skips that check.

Per application

The setting, the DNS host account, the console's figures and the webhooks belong to one application. A move only ever uses its own application's DNS host account. A call that names another application's account is refused with 422 dns_host_not_configured. GET /v1/applications/{id}/nameserver-migrations lists one application's moves. The nameservers.* webhooks go to the move's own application only.

Turn it on

In the console: Widget, Ways to connect, then the DNS hosting row (a Sandbox application has none). Pick Offer it or Offer it first; it saves at once, with CustomDomain™ running it. Change beside Who runs it opens the whole form: choose Who runs it and Save. Nothing changes for your users until you pick. Once on, each user is asked when they connect a domain. Turned off again, new users are not asked, and domains already hosted stay that way. The application's Settings and summary, the widget designer and the connect page show the same setting with a Change to that row.

With the API, PATCH /v1/applications/{id} with nameserver_migration. The API is the same as before the console's new words: its switches map to mode, and Who runs it to target.

In the consolemodeWhat the widget does
Off (the default)offNever offers it, nor any other DNS hosting. The application carries no setting.
Offer itofferShows it as a quiet second choice beside adding records.
Offer it firstpreferMakes it the first screen of the manual path. Adding records stays one tap away.

This is the one switch for every DNS hosting offer your users see. With it off, the widget never offers to host their DNS, even where managed DNS is available. A widget token also can't start managed DNS (403). With Your own account or your own nameservers chosen, the move to them is the offer. A widget token can't start CustomDomain™'s managed DNS then either (403). The offer may come back available: false for a domain, for example with registrar_locks_nameservers. Then the widget shows no hosting option for it at all. The console's widget designer shows this setting as DNS hosting: Off, Offered or Offered first, with a link to change it.

Who runs ittarget
CustomDomain™ (recommended, the default){"kind": "managed"}
Your own account, then the account{"kind": "dns_host", "account_id": "pacct_…"}
Advanced, Use your own nameservers instead{"kind": "custom", "nameservers": […]}
curl -X PATCH https://api.customdomain.ai/v1/applications/<APP_ID> \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{ "nameserver_migration": { "mode": "prefer", "target": { "kind": "managed" } } }'

An admin or an owner may name any connected account as the DNS host account. A member may name the accounts they connected. Naming another member's account is refused 403 forbidden, with nothing saved. That's because the account gets a zone for every domain moved to it. Keeping the account the application already has is not a new choice. So a member may change the mode and send the same target.

Send {"nameserver_migration": {"mode": "off"}} to turn it off. Once it is on, POST /v1/domains:check carries nameserver_migration for the domain, and only then. It holds mode, target, available, path, provider and registrar. It adds reason when available is false, such as registrar_locks_nameservers. The registrar lookup there waits 3 seconds at most, and the move looks again with more time.

When it is offered first

The setting above is the default place. The domain check also puts DNS hosting first, whatever the setting says, for a domain where it saves your user the most. rails.nameservers in the POST /v1/domains:check answer carries a verdict and a reason, and absent means the setting is off:

reasonverdictWhen
many_recordsrecommendedThe domain needs four or more records, as an email setup does: a lot to copy by hand.
no_automatic_wayrecommendedNothing but copying records by hand works for this domain.
application_prefersoffered_firstShow it as the first choice is on.
application_offersofferedEverything else: a second choice beside adding records.
plan_zone_limitofferedHosting would lead, but your workspace holds as many hosted zones as its plan counts (below).
a reason of the offer, such as registrar_locks_nameserversunavailableThe domain can't be moved to the target.

Some DNS providers have no record that can point a root domain (such as acme.com). Such a root has no reason of its own. A zone CustomDomain™ hosts can't point a root at a platform that gives no apex addresses either. That's because a hosted zone can't alias a hostname outside it (see Root domains). Hosting would not connect the root, so it isn't recommended for it. It is offered like any other domain, as offered, or as offered_first where Show it as the first choice is on.

On CustomDomain™'s own DNS, each hosted zone is one that CustomDomain™ runs for you. So putting hosting first is limited by a count that depends on your plan. While your workspace holds fewer zones than its plan counts, hosting leads where the table says so. At the count, or when CustomDomain™ itself is near its own limit, it stays on offer as a second choice (offered, plan_zone_limit). Your users can still choose it. The count only changes where hosting is shown. Nothing is refused, and nothing is billed for a zone. Hosting on your own DNS account or your own nameservers is not counted.

What your users see

With Show it as the first choice off, the widget's manual setup shows it as a quiet card beside adding records. It reads "Let Acme Sites keep your domain working" and "One change where you bought it. Your website and email keep working." With it on, the manual path opens on the consent screen, and Add records instead is one tap away.

The widget asks once, in plain words. The title names your platform and the domain ("Let Acme Sites keep acme.com working?"). Under it are "Your domain stays where you bought it. Only one setting there changes." and the nameservers now and after. Then come "Your website and email keep working. Nothing changes until your settings are in place." and "You can switch back any time." There is one button, Yes, set it up. For a domain whose DNS is at Cloudflare, it adds a line. It reads "Switching back to Cloudflare works for 7 days. After that you switch back to GoDaddy's own DNS." with the registrar's name, or "your registrar". It is white label: it shows your platform's name, never ours. The id and version of that consent text (nsm-consent, version 3) are stored with the move and the time. The person's address is not stored. A widget's move must name a consent text the widget shows (nsm-consent versions 1 to 3). So a stored consent always names the words that were on the screen.

Then the same screen shows its progress: copy settings, security check, make the change, live. It also shows the next thing to do. That may be a copy to check ("Check the copy before anything changes.", then Looks right, continue). It may be the nameservers to type at the registrar, or a button to sign in to the registrar with secure sign-in. Or it may say we are waiting on the registry. The registrar is named only when it is known. Otherwise the screen says "your registrar", never the DNS host's name. Move back is there while it can be, with the other way back beside it when both are possible. A finished move hands over to the usual success screen. Every string is in the widget's 41 languages.

A returning user's next name

A user's domain may already be hosted by CustomDomain™. Their next name under it needs no new move and no new question. For example, they host acme.com with shop.acme.com, then connect blog.acme.com. POST /v1/connections adds the name to the zone CustomDomain™ already runs, writes its records there and checks it at once. So the answer can already say live. The user is not asked again, and nothing changes at the registrar.

Only the right caller joins a zone, because a zone is one customer's whole DNS:

  • A widget token joins it only when the zone is that user's own. The new name must be theirs, and so must every name already in the zone. A name that carries the user's end_user_ref is theirs. One your API key made is theirs only for a name the token is bound to. The application must still offer DNS hosting on CustomDomain™'s own DNS. Who started the zone does not decide it. Once your API key, or another user, has a name in the zone, the user's next name does not join it. Another user of your platform may type a name under acme.com. They never get records written into that user's zone, because the name proves control by DNS, as it always did.
  • Your API key, or a token for your application, joins a zone of the application it creates the connection for.
  • A delegated agent token, a token that does not own the zone, and any other application or workspace do not join it.

The zone must be active, meaning the domain already answers from our nameservers. Each join is recorded in the workspace's audit log as dns.hosted_zone_joined. A name under a zone at your own DNS host account is not joined this way yet.

What each status means

A domain's page in the console shows three steps: Copying settings (pending, copying, needs_review), Waiting for the registrar (needs_dnssec_off through propagating) and Live (active). Domains you maintain and the domain's badge give its status in plain words, the first column here:

Console saysStateWhat happensWaits on
Setting uppendingYour own nameservers only: wait for zone_ready, then check your nameservers answer for the zone.you
Setting upcopyingCreate the zone (managed DNS, or your DNS host account), copy the domain's records into it with the connection's own, count the mail records (The copy). A copy whose write to the DNS servers failed is retried, never switched to. Retried every 2 minutes for 6 hours.us
Check the copyneeds_reviewThe copy is not proven complete: it was read from public DNS, or some records could not be carried over. copy_warnings says what to check, and the move goes on once a person confirms it (copy_reviewed: true; in the console, The records look right, continue). 14 days at most.a person
Waiting for the userneeds_dnssec_offThe registry publishes a DS record and we cannot remove it ourselves.the person
Waiting for the registrarwaiting_dsDNSSEC is off. Wait until the registry stops publishing the DS record and its TTL has passed (5 minutes to 48 hours; 1 hour when unknown).the registry
Waiting for the user (paths manual and agent), or Waiting for the registrar (path api)settingThe nameservers are being changed (waiting_for says by whom). With a key, the registrar is read first and its answer is read back (below); when its answer was lost and it cannot be read back yet, the move waits here with waiting_for: registrar_confirm, can still be moved back, and the next check reads back first. 14 days at most.the registrar or the person
Almost livepropagatingChanged. The delegation is read every 5 minutes for 2 hours, then hourly up to 48 hours.the registry
MaintainedactiveThe registry lists every new nameserver. Read again every 6 hours: a move away is failed with delegation_drift, and back again is active. Once a day, whether the old nameservers still answer for the domain (old_dns_serves), which decides the default way back.
Stoppedfailedfailure_code says why. A delegation failure is still read twice a day for 14 days, and turns active if the delegation becomes the new one.
Moved backrolled_backMoved back. No longer maintained.

Why a move stopped, as failure_code and as the console says it:

failure_codeConsole says
zone_copy_failed (also a copy not confirmed within 14 days)Copying the zone failed
zone_not_servedThe new nameservers did not answer
dnssec_timeout (after 7 days)DNSSEC stayed on
ds_removal_failedDNSSEC could not be turned off
credential_refusedThe key was refused
registrar_refused (it was read back and still lists the old nameservers)The registrar refused
registrar_lockedThe domain is locked
changed_elsewhere (the registrar listed other nameservers than the ones the move started from, so they were not overwritten)Changed elsewhere first
agent_failedThe sign in did not finish
delegation_timeoutThe registry never showed it
delegation_driftMoved away after
internalSomething went wrong on our side

A zone has one open move at a time. So two connections under one registrable domain (acme.com and shop.acme.com) share it. A move of the same zone for another account is refused with 409.

The copy

The new DNS host must hold every record the domain relies on before the nameservers move. Otherwise the switch takes the website and the mail down. There are two ways to know them, and the move says which in copy_source:

  • api: the whole zone, read through the old DNS host's API. CustomDomain™ may hold a key at the DNS host the domain uses now: a sign-in kept for the connection, or a connected account there. Then every record is read through that host's API. Such a copy is proven complete, unless a record could not be carried over. Examples are a forwarding rule, or a root CNAME a host flattens, and copy_warnings names them.
  • discovery: read from public DNS. Public DNS cannot list a domain's records. So we ask about the names domains commonly use, one by one. Such a copy is never proven. The move waits in needs_review until a person checks copy_warnings and confirms it. Your server may accept it in advance by sending copy_reviewed: true with the start. A copy that read nothing at all always waits for a person, and in the widget only after the end user saw it. For a domain whose DNS is at Cloudflare, some records answer with Cloudflare's proxy addresses. We don't copy those as if they were the website's own address. We leave them out and name them, so the person adds the real addresses or connects the Cloudflare account.
  • existing_zone (your own account only): your zone already held records, which are kept; only the connection's own records are written.

Nothing changes at the registrar until the copy is at the new DNS servers: a copy whose write failed is retried, never switched to. When a person confirms a copy, the time is kept (copy_reviewed_at).

How the nameservers change

No standard lets a third party ask a registrar to change a domain's nameservers. Domain Connect changes records only. CDS and CSYNC (RFC 7344, RFC 7477) need the current DNS host to publish them, and the domain to be signed with DNSSEC. Most domains are not signed. So each move takes one of three paths:

pathHowCredential
apiThe registrar's own API.A key the customer created, at the registrar: a connected provider account, or a key sent with the call and used once, never stored. The connection's linked account is used when it is at the registrar, also for an end user's move.
agentSecure sign-in: the end user signs in to their registrar and approves a plan whose only step is the exact new nameservers (or turning DNSSEC off, or for a move back the old nameservers or the registrar's own DNS). Only those controls are opened, and only the approved values are typed; DNSSEC stays closed unless the plan turns it off. A code the registrar asks for is handed back to the person.None: the person's own sign-in.
manualThe person sets them at the registrar with the values shown.None

We don't take a registrar's answer at its word. Before a change, we read the registrar. It must still list the nameservers the move started from, so a change someone made there since is never overwritten. Otherwise the move stops with changed_elsewhere. After an error, we read the registrar back, then the registry. That's because a timeout can come after the registrar acted. The new nameservers mean the change happened. The old ones mean it did not (registrar_refused). No answer leaves the move in setting with waiting_for: registrar_confirm.

What each registrar's API can do:

RegistrarReadChangeRemove a DS recordBack to its own DNSMost nameservers
GoDaddyyesyesnono (secure sign-in or by hand)13
Namecheapyesyesnoyes (BasicDNS)12
Name.comyesyesyesyes13
Porkbunyesyesyesyes13
Hostingeryesyesnoyes4
Spaceshipyesyesnoyes12
IONOSyesno (secure sign-in or by hand)nono (secure sign-in or by hand)

Secure sign-in can change the nameservers at Namecheap, GoDaddy and Name.com, where it is offered. It can choose the registrar's own DNS at Namecheap ("Namecheap BasicDNS") and GoDaddy ("GoDaddy Nameservers"). A lasting API key made at sign-in counts as a connected account, at GoDaddy with GoDaddy's permission. It changes the nameservers only for domains of the application it was made for. A key is never read during a move's own sign-in.

Why DNSSEC comes first

DNSSEC is a security lock some domains have on their DNS. The registry publishes a DS record, and resolvers use it to check that answers come from the domain's DNS host. When the registry publishes one, the nameservers must not move until it is gone and resolvers have dropped it. Otherwise validating resolvers would stop answering for the domain. Some registrars' APIs remove DS records, such as Name.com and Porkbun. With a connected account that keeps access there (path api), we remove it and wait (waiting_ds). Otherwise the move stops at needs_dnssec_off. The workspace's owners and admins get a "needs attention" notification. The secure sign-in path offers a session whose only step is turning DNSSEC off. Some registrars turn DNSSEC on by default, Squarespace and Spaceship among them, so expect it.

The new DNS host does not sign the zone. Turning DNSSEC on again there is the DNS host owner's choice after the move.

What moving back does

A domain can be moved back two ways, and a move back names one in rollback_target:

Way backrollback_targetWhere the domain's DNS goesWhen it works
To the previous nameserverspreviousBack to the DNS host it had before (old_nameservers). We never touched the records there, so the domain answers as it did before the move.Only while that host still answers for the domain. Some hosts delete a domain's records a few days after its nameservers move away: Cloudflare deletes such a zone after 7 days, and its support cannot restore it. So the old nameservers are asked first, and a move back to ones that no longer answer is refused with 409 old_dns_gone.
To the registrar's own DNSregistrar_defaultThe registrar's "use our nameservers" choice (often called its default DNS). It holds the records it had before the move, not the ones changed since; at Spaceship and Squarespace DNSSEC may sign the domain again.Always.

Without a choice, a move back goes to the previous nameservers while they still answer. Once they do not, it goes to the registrar's own DNS. The move says which. rollback_default is where a plain move back goes. rollback_targets lists the ways possible now, and leaves out previous once the old nameservers stopped answering. old_dns_serves says whether they still answered when last asked. We ask once a day while the move is active, and at a move back. A domain that used the registrar's own DNS when the move started goes back through the registrar's own reset. It does not set its old names as custom ones.

How it is made, in rollback_path:

  • api: through the registrar's API, at once (rollback_set_at), with a key sent once or the move's connected account. For the registrar's own DNS, this is its reset call where it has one: Namecheap, Spaceship, Name.com, Porkbun and Hostinger (table above).
  • agent: the end user signs in to the registrar with secure sign-in (purpose: nameservers). They approve the move back to the old nameservers, or to the registrar's own DNS. This is the way to the registrar's own DNS at GoDaddy, and elsewhere without a key.
  • manual: next_step says what to set, or what to choose at the registrar.
  • none: nothing had changed at the registrar yet, so the move is just stopped.

A move back reads the registrar first. It must still list the move's nameservers. If someone changed them since, the answer is 409 changed_elsewhere, and nothing is written. A list already where the move back goes counts as done, for example after an earlier answer was lost. A registrar error is read back too. 502 registrar_refused means nothing changed. 504 registrar_unconfirmed means it cannot tell, and nothing is recorded, so try again. The move stays stopped, so a later check does not send the new nameservers again. Any secure sign-in still working on the move is ended first. It is idempotent, and the nameservers.rolled_back webhook says where it went (rollback_target).

In the console, the domain's DNS tab offers the default way first. That is Move back, or Move back to GoDaddy's DNS once the old nameservers no longer answer. Beside it sits the other way, when it is possible. Each asks first ("Move acme.com back?") and says what it does. One reads: "Its nameservers go back to the ones it had before. Its previous provider still answers for it, so it works as before." The other reads: "It goes back to GoDaddy's own DNS, with the records it held there before the move. Records changed since then are not in it." In the widget, your user sees the same two buttons.

A move back does not yet do three things. It does not copy the connection's records into the registrar's DNS. It does not restore how the connection was written before the move. It does not delete the zone the move created.

API

RouteWho may call it
PATCH /v1/applications/{id} with nameserver_migrationAn API key that can write applications.
POST /v1/connections/{id}/nameservers:migrateAn API key; a widget token (the end user: the application's mode must be offer or prefer, consent must name a text the widget shows, target, a key and the zone flags are refused, and copy_reviewed is taken only for a move in needs_review); an agent token with domains:connect (only while the application's mode is offer or prefer, else 403 ns_not_offered; no target but the application's own, and no skip_zone_check: 403 target_not_allowed). An agent token or a widget token never resumes the open move of another application of the workspace (409).
GET /v1/connections/{id}/nameserversAn API key, a widget token, or an agent token with domains:read. Every answer that carries a move also carries next_action (below).
POST /v1/connections/{id}/nameservers:rollback with an optional rollback_targetAn API key; a widget token (it may choose where, but not send a key); an agent token with domains:connect (its move back is recorded as agent.acted).
GET /v1/applications/{id}/nameserver-migrations?limit=&since=An API key: one application's moves and their stats.
GET /v1/connections?dns_hosting=hosted, moving or anyAn API key, an app-scoped token or an agent token with domains:read: the domains whose DNS CustomDomain™ runs (below). Any other value is 400.
POST /v1/connections/{id}/browser:start with "purpose": "nameservers"The widget or the console: the secure sign-in session of the agent path, once the move waits for it (waiting_for: browser_session).

Find the domains that are hosted

Every connection carries dns_hosting, on the connection list and on GET /v1/connections/{id}. Its state is none, moving, hosted or failed. It adds by, provider, zone and since once there is something to say. Ask the list for the domains whose DNS CustomDomain™ runs with ?dns_hosting=hosted. moving keeps those being set up or moved, and any keeps hosted, moving and failed. A page is always full, and next_cursor keeps walking the matching rows. In the console, Domains has the same list as a button, DNS hosted by us (the Domains filters).

This finds a domain whose DNS is hosted by a move. It also finds one whose zone you started with managed DNS and never moved. The list of moves above holds moves only. A subdomain counts when its parent domain is hosted (shop.acme.com under acme.com). A move that was rolled back is not hosting. Neither is a move that failed, unless it failed because the domain's nameservers moved away again.

Start a move from your server through the customer's connected registrar account:

curl -X POST https://api.customdomain.ai/v1/connections/<ID>/nameservers:migrate \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{ "path": "api", "provider_account_id": "pacct_…" }'

A provider account given for some domains only (scope selected) moves only those domains' nameservers. For any other domain, the call answers 403. A move already under way stops using it once the domain is taken off its list. To use a key once instead, send provider (the registrar's id, such as porkbun) and credential: {"token": "…"} in the registrar's key format. It is used for that call and never stored.

201 creates the move. 200 resumes the domain's open one with what the call brings: a key, zone_ready, or copy_reviewed once a person checked the copy. The answer is the move as far as it got in that call. With a registrar key and no DNSSEC, it is often already propagating. Poll GET /v1/connections/{id}/nameservers until state is active, failed or rolled_back. waiting_for says what it waits on, and next_step is one sentence for a person. The shape is illustrative. The API reference has every field under Nameservers.

The 422 refusals say why a move cannot start. nameserver_migration_unavailable explains why in details. nameserver_api_unsupported means the registrar has no API call that changes nameservers. nameserver_agent_unavailable means secure sign-in cannot change this registrar's nameservers. registrar_locks_nameservers means Cloudflare Registrar (above). registrar_mismatch means the key or account is at a company other than the domain's registrar. The others are zone_host_unsupported and dns_host_not_configured.

Agent tokens move nameservers only while DNS hosting is on. Moving a domain's nameservers hands the whole domain, mail included, to whoever runs the new ones. So an AI agent may do it only for an application that offers it (mode offer or prefer). With the mode off, or no setting saved, every call to :migrate by an agent token is refused with 403 ns_not_offered. It changes nothing. That covers a start and the resume of a move a person began. It writes no row and calls no registrar. A person can turn DNS hosting on in the application's settings, where the DNS hosting card offers it. Or your platform can start the move for one domain with its API key, which this rule leaves as it was. Your end users' widget keeps its own 403 for an application that does not offer it. Moving back (:rollback) stays open to an agent, so it can undo a move.

Agent tokens never choose where the nameservers go. A delegated agent token is an AI agent acting for a person. It may start a move only to the application's own target, and may not send skip_zone_check. Anything else is refused with 403 target_not_allowed. With a registrar account linked, nameservers an agent chose would hand it the whole domain in one call. Your own API key may still name managed or custom.

Agent tokens and widget tokens act only on their own application's moves. Two applications of one workspace can share a customer's zone, with www in one and the apex in another. A credential bound to one application never resumes the other's open move. The call answers 409, with no word of the move. Only an API key, which spans the workspace, resumes it. Every start, resume or move back by an agent token that changed the move is in the audit log. It shows as agent.acted (moved a domain's nameservers, moved a domain's nameservers back) under agent:<grant id>, whichever key it used. A call that only read the move leaves no row.

Start one domain's move

A person starts the move for one domain from the console, whatever the application's DNS hosting setting says. The setting decides what the application's users are offered, and only an agent token is held to it. Before it offers a way, the console asks GET /v1/connections/{id}/nameservers:offer. So it offers nothing the move would refuse. An API key, an app scoped token and an agent token with domains:read may ask. An app scoped token is offered no saved account. An end user's widget token may not ask (403). It is offered the move in the domain check, and starts it with its consent. The answer is read-only and changes nothing.

{
  "available": true,
  "zone": "acme.com",
  "setting": "off",
  "target": "managed",
  "registrar": { "name": "GoDaddy", "provider": "godaddy", "source": "rdap" },
  "paths": {
    "api": { "available": true, "accounts": [
      { "id": "pacct_...", "label": "Acme", "provider": "godaddy", "provider_name": "GoDaddy", "how": "api_key" }
    ] },
    "agent": { "available": true },
    "manual": { "available": true }
  }
}

target is where the move hosts the zone: the application's setting, or else CustomDomain™ (managed). The three paths are the ways the nameservers change. api uses one of the accounts as provider_account_id. agent goes through the secure sign-in. manual means the person makes the change at the registrar. The accounts are the connected accounts at the domain's registrar that the caller may use. They are kept keys of the workspace that serve the application and already hold the zone. A key given for one subdomain, such as shop.acme.com, does not hold acme.com. So it is not listed for the move of the registrable domain. The registrar's API must change nameservers. An end user's own key is never listed, and neither is the key itself. A registrar CustomDomain™ does not connect to has none. An agent token reads a key made for another application and shared with its own as "{provider} key".

Which account a caller may use. The move holds every account to the same rule the offer lists by. That holds whether the call names the account or the start picks one:

CallerMay use
An API key (the console's, or a member's)The accounts an admin or an owner connected, and the ones the key's own member connected. Never another member's.
An app scoped tokenNone. It has no member behind it, and a member can make one, so it names no saved account, picks none and is offered none. It moves by hand, by the secure sign-in, or with a key it sends with the call (used once, never kept).
An agent tokenThe same, for the application its grant is bound to.
An end user's widget tokenNone. It names no account.

A start that names an account the caller may not use is refused 403 forbidden before any move exists. A start that names none takes the connection's linked account, or one at the registrar that holds the domain. It picks only among the accounts the caller may use. When there is none, it goes on without one, by the secure sign-in or by hand. path: api is then refused 400. A resume and a move back that name an account are held to the same rule. A move back also refuses an account at a company other than the registrar the move named (422 registrar_mismatch). A move by the secure sign-in keeps no account.

A resume that only sets skip_zone_check sends the move on to the registrar at once, with the account it was started with. So it needs someone who may use that account, or it gets 403 forbidden. Marking the zone ready with zone_ready does not, and stays open. A call that fails changes nothing on the move: not the connection, not the account it named, not the provider.

When available is false, reason says why:

reasonMeaning
platform_subdomain, unsupported_tld, reservedThe domain's nameservers cannot be changed at a registrar.
registrar_locks_nameserversThe registrar requires its own nameservers (Cloudflare Registrar). Moving them takes a transfer first.
missing_scopeAn agent token that holds domains:read and not domains:connect, which the move needs.
ns_not_offeredAn agent token asked while DNS hosting is off. An API key and the console are never held to this.
dns_host_unavailableThe application's DNS host account no longer works.
move_openA move for this domain is already under way.
disabledThe deployment has no managed DNS for target managed.
zone_limitA cap of the engine's own is reached: the workspace's, or the deployment's.
plan_zone_limitThe workspace holds as many hosted zones as its plan counts.

A domain whose zone exists already adds none, so neither limit applies to it. The offer is stricter than the move in two places, on purpose. It stops at the plan's count, where the move stops only at its caps. It lists kept keys only, since a move waits hours for the registry and a one time key ends in an hour. Every account it lists starts a move for that caller. Every account it leaves out is refused by the move. A suspended workspace is refused the offer (403 workspace_suspended), as it is refused the move.

What to press next

Every answer that carries a move has next_action: the one request to press next, or null when nothing is waiting for a press. waiting_for and next_step say what a move waits on in words; next_action says which button to show. It is { "kind", "method", "path", "body" }, with the connection's id in path, and it is the same for every caller.

kindWhenThe request
sign_inThe move waits for the secure sign-in (needs_dnssec_off or setting on the agent path), or a move back by secure sign-in is not made yet.POST /v1/connections/{id}/browser:start with {"purpose": "nameservers", "provider": "..."}. Add the return_origin and consent_version you send for any sign-in.
rollbackThe move failed after the registrar was changed or asked (can_rollback is true), for example delegation_timeout or delegation_drift.POST /v1/connections/{id}/nameservers:rollback with {"rollback_target": "..."}, the default way back.
retryThe move failed before anything changed at the registrar (can_rollback is false), for example zone_copy_failed or credential_refused.POST /v1/connections/{id}/nameservers:migrate with the body it carries: {"path": "..."}, the move's own path, and for api also "provider_account_id", the account it was made with (an end user's start also sends consent, and reads the path only).

A retry repeats the same move. A start with no body picks its path afresh, which is not what failed. After a move by hand it could take a saved key. With two keys at the registrar, it could take the newer one. Send the body as it is. A move made with a key sent with the call keeps no account. So its retry is {"path": "api"}, and you send the key again.

It is null while the move copies. It is also null while the move waits for a copy review (copy_reviewed), for the registry, or for DNSSEC. The same goes while it waits for a person to make the change at the registrar, or for a key to be reconnected. It is null once the move is active, and when it is over.

Because next_action is the same for every caller, it can name a request the caller who reads it is refused. There are four such cases. A caller in one of them does not send the request; it tells the person what next_step says.

  • sign_in points at browser:start, which runs only from a customer's browser or the console. It refuses every agent token, and every API key without the console's label, with 403 browser_customer_present_only (secure sign-in).
  • retry is refused to an agent token while the application's DNS hosting is off (403 ns_not_offered), even when the failed move is one a person started.
  • retry is refused to a widget token (the end user) when the application's setting is off (403 forbidden, "this application does not offer nameserver migration").
  • retry of a move made with a connected account is refused (403 forbidden) to an API key whose member may not use that account: another member's.

rollback is open to all of them whatever the setting says.

A move back takes {"rollback_target": "previous"} or {"rollback_target": "registrar_default"}, or nothing for the default (What moving back does). These are its refusals. 409 old_dns_gone means the old nameservers no longer answer, so move back to the registrar's own DNS instead. 409 changed_elsewhere means the registrar lists nameservers other than the move's. 502 registrar_refused means nothing changed. 504 registrar_unconfirmed means the answer was lost and could not be read back, so try again.

Webhooks

Seven events follow a move. Each carries a nameservers object, and is written to the domain's timeline as a row of the same kind. When they are known, the object also names the registrar (name, provider, iana_id) and the old_dns_host. On nameservers.rolled_back, it says where the move back went (rollback_target). See the event catalog and the payload.

EventWhen
nameservers.startedA move was created.
nameservers.dnssec_clearedThe registry stopped publishing the DS record.
nameservers.changedThe registrar took the new nameservers, or the delegation first showed one.
nameservers.activeThe registry lists every new nameserver.
nameservers.failedThe move stopped (failure_code).
nameservers.rolled_backMoved back, to the previous nameservers or the registrar's own DNS (rollback_target).
nameservers.driftedAn active move's nameservers were changed away (observed_nameservers). It is also an inbox item and the drift email.

MCP

The MCP server has three tools for it. check-nameserver-status needs domains:read. migrate-nameservers and rollback-nameservers need domains:connect, and both need confirm: true. An agent sends confirm: true only after the person agreed. The tools never send a registrar key. With an agent token, migrate-nameservers refuses target and nameservers. The application's setting decides where the nameservers go, and the control plane refuses the same (403 target_not_allowed). A move that another application of the workspace has open is never resumed with an agent token (409). While the application's DNS hosting is off, migrate-nameservers is refused with the error ns_not_offered, and changes nothing. The agent does not retry. It tells the person they can turn DNS hosting on in the application's settings, or that the platform can start the move with its API key. rollback-nameservers is not refused. migrate-nameservers takes copyReviewed once the agent showed the person the copy's warnings and they agreed. rollback-nameservers takes target (previous or registrar_default). Results carry registrar, oldDnsHost, copySource, copyWarnings, rollbackDefault and rollbackTargets.

In the console

  • Widget, Ways to connect, DNS hosting: Off, Offer it and Offer it first, saved when you pick one. Change beside Who runs it opens the form. It has the switch Host your users' DNS. It shows a before and after picture of a user's domain. Where it is registered stays, and what keeps it working moves to CustomDomain™ or your host. It has Who runs it: CustomDomain™, or your own Cloudflare, Amazon Route 53, Google Cloud DNS or Azure DNS account. Your own nameservers sit under Advanced. It ends with Show it as the first choice. A ? beside DNS, registrar and nameservers gives one plain line and a link here. Every card links to the part of this page that explains it.
  • Where else the setting shows: the application's Settings has a DNS hosting section. Its summary, the widget designer and the connect page read it out as Off, Offered or Offered first. Each has a Change that opens that row. Beside it, See hosted domains opens Domains narrowed to the domains hosted for the application (find them). There, DNS hosted by us and the DNS host column say who runs each one, and which moves need a look.
  • Host its DNS instead sits on a domain's page under Change, and on the connect page under the detected DNS host. It opens a sheet that starts the move for that one domain, from what the offer above allows. It lists the choices with nothing picked. There is a row for each saved account at the registrar, Secure sign-in, and Change it yourself. Change it yourself shows the nameservers for you to set at the registrar. With no account you may use, a line says so and links Add an account. When the move cannot start, the sheet says why in one line, and has nothing to start. It adds a link where there is a place, such as See plans for the plan's limit. Members, admins and owners can start it, and a viewer sees the buttons off. Once it starts, the sheet goes to the domain's DNS tab.
  • The waiting card's buttons come from next_action (above). While a move waits for the registrar sign-in, the card shows Sign in at GoDaddy. It opens the secure sign-in over the page, and closes it when the move moves on. After a stop that changed nothing at the registrar, it shows Try again. That starts the same move again, by the same path and with the same account, without choosing a way afresh. After a stop that did change something, Move back is the first button. A viewer sees none of them.
  • A domain's DNS tab has a Domain maintenance section. It shows the status, the three steps and the next thing to do. For a copy to check, it says what to check and offers The records look right, continue. It shows the domain's two parts, naming the registrar, with its logo, only when it is known. It shows where the records are. For CustomDomain™ they are listed below, and for your own account you see a count and a link to your host's console. Its nameservers sit under Technical details. It also shows the ways back: Move back, and Move back to GoDaddy's DNS beside it or in its place. A domain your own DNS host runs is not offered CustomDomain™'s managed DNS there.
  • Webhooks: a Nameserver moves group in the event picker. The domain's timeline has a sentence for each event.

A move is not billed on its own. CustomDomain™ bills connected domains. A zone it hosts counts toward the account's managed DNS zone limit.

What changes for your users

In the words you can give them.

What am I agreeing to? That the platform keeps your domain working for you. One setting changes at the company you bought your domain from. That lets the platform keep your domain's settings correct, renew its certificate and fix problems without asking you again.

Will my website or email stop working? No. Your settings are copied first, email included, and nothing changes until they are in place. If some could only be read from outside, you are asked to check them first.

Does my domain move to another company? No. It stays registered where you bought it, with the same renewal date and the same owner. You keep paying for it there.

What do I have to do? Say yes. Sometimes the change can be made for you. If not, you either paste the values shown at the company you bought your domain from, or sign in there and approve the change. The screen tells you which.

How long does it take? Usually minutes. It can take up to 48 hours to show everywhere.

Why do I have to turn off DNSSEC? DNSSEC is a security lock on the old settings. It must be off before they move, or the domain would stop working during the move. You can turn it on again afterwards.

Can I switch back? Yes, any time, two ways. To your previous provider, while it still has your records: some delete them a few days after the domain moves away (Cloudflare after 7). Or to your registrar's own DNS, which is always there, with the records it held before the move.

Who can change my records afterwards? The platform, through the DNS host it uses. You can still ask it to change or show them.

On this page