HOC SiteDocumentation

Connect a custom domain

Serve the public site on your own hostname instead of the platform path-prefix URL (https://hoc-site.com/{websiteId}/{locale}/…).

Before you start

  • An active subscription whose plan includes at least one custom domain (Starter and above include domain slots; preview-period sites use the Starter domain limit). Add domains until the plan’s domain quota is reached.
  • Access as a website superadmin.
  • Prefer lowering the DNS TTL (for example to 300 seconds) on the old records a day before the cutover so the switch propagates faster.

1. Add the hostname

Open the website in the admin panel → Settings → Domains, or call add_website_domain. Add each hostname you want visitors to type (for example www.example.com and, separately, example.com).

The first domain you add becomes primary automatically. Primary is the host used in absolute public links (liveUrl, emails, sitemaps) when a custom domain is live — it is not a subdomain of hoc-site.com.

2. Create DNS records

Each domain row returns dnsRecords (also under get_website_settings with sections=domains or verification). Create one of the following at your registrar for that hostname. CNAME is preferred — use it whenever the registrar allows (subdomains always; apex if ALIAS/ANAME/CNAME flattening is available). Use an A record only when the registrar cannot CNAME the root.

Use whenTypeNameValue
Preferred (subdomains such as www.example.com; apex when flattening is available)CNAMEthe hostnamecustom.hoc-site.com
Apex / root (example.com) only if CNAME is not possibleAthe hostname188.245.178.174

Do not create both an A and a CNAME for the same name.

www and apex together: add both hostnames as separate domains, point each with the matching record type above, then set the visitor-facing host as primary. Redirect the non-primary hostname to primary at the registrar (URL forward) or with a DNS-provider forward that stays DNS-only — not a Cloudflare orange-cloud page rule or proxied redirect. The platform serves every verified host and does not auto-redirect apex ↔ www; visitors keep the hostname they typed unless you set up that forward yourself.

Cloudflare: every platform record must stay DNS only (grey cloud). Proxied (orange cloud) records break domain verification and TLS issuance. Do not use Cloudflare Proxy + Redirect Rules to glue apex and www onto the platform — verify both hosts (or forward at the registrar), then keep the Cloudflare records grey.

3. Verify and wait for TLS

Use Domains → Verify after DNS is in place (verification probes https://{domain}/api/domain-verification). Propagation is often minutes but can take up to 48 hours depending on the registrar.

While DNS is wrong or TLS is not issued yet, visitors may see connection errors or the previous host. Once verification succeeds, TLS is issued automatically — there is no separate certificate step.

4. Set primary (optional)

If a later domain should own published links, use Set as primary on that row. Until a custom domain is primary and verified, public URLs keep the platform path-prefix form.