Custom domains, path routing, game subdomains and Domain Connect
A service is always reachable on a free platform address. This guide is how you make it answer on a name of your own. Which of these your service has depends on its product, so ask for its capabilities first: custom_domain and external_access appear when it supports them. The samples use the helper from Using the Zaroz API.
| You want | Use |
|---|---|
www.example.com in front of a website or API | Custom domain |
example.com/api to reach a different service than example.com | Path routing |
play.yourgame.zaroz.cloud for a game server | Game subdomain |
| Your DNS provider to create the records for you | Domain Connect |
Domains that need a certificate use automatic TLS, so the name must already point at Zaroz in DNS before the certificate can be issued. A pending domain is normal while you wait for DNS; it is not an error.
Custom domains
Prove you own the domain
Unless the name is one single label under a parent domain Zaroz itself registered for you, the organization must first prove control of the domain with a DNS TXT record: see Verify a domain. Names inside Zaroz's own DNS zone are refused for good, and a name another organization already holds is refused with the same answer as one you have not proven, so this API cannot be used to find out who owns what.
Cover every name under a domain
Proving example.com proves that one name. If you want app.example.com, api.example.com and any other name under it without a TXT record for each, turn on subdomain coverage for example.com (console: the domain's page, Cover subdomains; API below). Coverage asks for a different TXT value at the same _zaroz-challenge.example.com name, so an existing proof never widens by itself:
curl
Code
Publish that value (you can replace the old one), then check the domain. subdomain_coverage moves from awaiting_record to active, and from then on any name under example.com can be attached to your organization's services directly. The domain itself stays verified by its old value while you wait.
What coverage never reaches:
- Names delegated elsewhere. If a name between the domain and the one you attach has its own nameservers (an
NSdelegation), it is someone else's zone: verify that name separately. - Public suffixes. A name on the Public Suffix List (
co.uk,github.io, ...) can never cover the names below it, and coverage never crosses one. - Other organizations' names. A name another organization already uses is refused exactly as before.
Once coverage is active, only the subdomains value proves the domain. If it disappears, the domain goes through the usual lost-proof path: a notice, 14 days of grace, then everything attached under it that has no proof of its own is detached. Turning coverage off ({"enabled": false}) is refused while a service uses a name under the domain that has no proof of its own; the refusal names them. A domain registered with Zaroz already covers every name under it.
Check, attach, wait, detach
Ask first whether a name could be attached; it changes nothing.
curl
Code
TypeScript
Code
Python
Code
- Create a CNAME (
www.example.comto the platform host the listing returns asplatform_host) at your DNS provider. A bare domain (example.com) cannot hold a CNAME: use your provider's ALIAS, ANAME or CNAME-flattening record to the same target. statusgoespending, thenactive(route and certificate live) orfailed(usually the certificate: it cannot be issued until the DNS points here; fix the record and it retries).- Attaching is idempotent: a name already attached to this service is re-applied and returned. A service holds a limited number of domains (
limitin the listing), and a service that publishes no HTTP cannot take one. - Detaching removes the route, the certificate and your claim on the name, so you can attach it again later. The free platform host cannot be detached.
Domains on an HTTPS endpoint
A Workload publishes websites and APIs as HTTPS endpoints (see Public ports and endpoints and Add a public port). Their domains are managed on the endpoint:
curl
Code
TypeScript
Code
Python
Code
The response tells you the exact DNS record to create (dns). A refusal names its reason before the colon in details: invalid_domain (400), or platform_domain, domain_taken, domain_not_verified, domain_limit, not_ready (422). A failure code explains a failed domain.
Path routing
Once a domain is on an HTTPS endpoint you can send some paths elsewhere, so app.com reaches one service and app.com/api another. The target must be an open HTTPS endpoint of a service in the same project. The longest matching path wins; the endpoint the domain is attached to answers everything else. The call replaces the whole set, and an empty list removes every path.
curl
Code
TypeScript
Code
Python
Code
With strip_prefix: true the target receives /users; with false it receives /api/users. Each rule has a status: serving, starting (its target is not live yet), shadowed (another rule with the same path always wins, so this one never serves) or broken (its target cannot answer). Refusals: invalid_path and target_not_found (400, a missing, closed or other-project target all answer alike), and path_limit, duplicate_path, target_not_http (422).
Game subdomains
A game server can take a free name under a platform zone (<name>.<zone>), pointing at its public address, with an SRV record for games that read a port from it. A service holds one.
curl
Code
TypeScript
Code
Python
Code
status is pending (records being created), active, failed (retried automatically) or deleting. PATCH .../game-subdomains/{id} with a new name replaces it (the answer carries a new id), and DELETE releases it. A name stays taken for a while after its previous holder released it. Refusals: zone_unavailable, invalid_subdomain, subdomain_taken, already_has_subdomain (422).
For a FiveM server behind your own domain, see custom domain in the server list.
Domain Connect
If your DNS provider supports Domain Connect, Zaroz can send you there to approve the exact records instead of you copying them. It never writes your DNS itself. Only products that declare a template (game servers with an SRV record) offer it, and a deployment may not run it at all: check domain_connect in what the deployment offers.
curl
Code
TypeScript
Code
Python
Code
verify checks live DNS: active once the SRV record is published and points at the expected host and port, failed when a different record is found, pending while nothing has propagated. Releasing a link does not touch your DNS provider; remove the records there yourself. A service holds at most 20 links, and a provider without a synchronous flow cannot be used (create the records by hand).
Raw ports with an HTTP domain
A service with external access can also publish a domain in front of one TCP port, with a managed certificate, through POST /service-instances/{id}/external-access/{allocation_id}/http (body {"domain": "..."}). It follows the same rules as a custom domain (DELETE on the same path removes it). Opening, closing and quota of the ports themselves are in Public ports and endpoints.
