Skip to content

RegistrarDomain

Source: src/Cloudflare/Registrar/Domain.ts

The mutable Cloudflare Registrar settings (auto_renew, locked, privacy) on a domain that is already registered with Cloudflare Registrar.

Domains cannot be registered or released through the API — purchases, transfers, and renewals happen in the Cloudflare dashboard. This resource therefore never creates or deletes a registration: reconcile adopts the existing domain and converges only the settings you declare, and destroy restores the settings the domain had before Alchemy first managed it (captured as initialSettings). The domain itself always survives a destroy.

Settings you omit are left untouched, both during reconcile and during the restore on destroy.

Note: updating registrar settings requires an API token with Registrar write permission; without it the update fails with the typed RegistrarUpdateNotAllowed error.

Pin auto-renew and the transfer lock

yield* Cloudflare.RegistrarDomain("ApexDomain", {
domainName: "example.com",
autoRenew: true,
locked: true,
});

Enable WHOIS privacy only

// autoRenew and locked are omitted, so they are left untouched.
yield* Cloudflare.RegistrarDomain("ApexDomain", {
domainName: "example.com",
privacy: true,
});
const domain = yield* Cloudflare.RegistrarDomain("ApexDomain", {
domainName: "example.com",
autoRenew: true,
});
// domain.expiresAt, domain.currentRegistrar, domain.registryStatuses, ...