Skip to main content
Live. This area is documented as current, user-reliable behavior.

Goal

Get from owning a domain to routing it where you actually need it.

Prerequisites

  • An existing domain in the portfolio

Workflow

1
Open the domain and inspect DNS controls.
2
Add or review the records required for the target service.
3
Use the project connection surface when the domain is meant for an application deployment.

DNS management behavior

  • Nameservers are editable separately from individual records.
  • The UI distinguishes system-managed records from user-managed records.
  • DNS changes are immediate in the control plane, but propagation still depends on registrar and DNS timing.

When a partner asks to set up your domain

A partner platform you use, such as a shop builder, may add your domain to set up email or a website for you. If you bought that domain on StackShift under your account, the partner cannot change your DNS by itself. StackShift asks you first, by email and in Domains, and the partner never sees your records. If the partner bought the domain itself, there is nothing to approve.
  • What you see: the email links to the request in your dashboard, and pending requests are listed in Domains. Each one names the partner, the domain and what it is for, email, a website or both.
  • Every change is listed before you decide. A record to add is shown with its type, name and value. Your SPF record is updated by adding StackShift’s include and keeping everything already in it. Your DMARC record stays as it is. If the partner wants the domain’s address records for a website, the records they replace are listed with their current values. Website records read StackShift website address, and the real address is filled in when the website goes live.
  • If a record conflicts with one you already have and StackShift cannot add it, the request says why in a plain sentence. You can still approve, but it will fail and show the reason.
  • Approve: StackShift writes every record into your StackShift DNS, leaves your other records alone, and the partner continues setup on its own. It checks that the records you reviewed are still the same, and if they changed it asks you to review again. Nothing is charged.
  • If writing the records fails, the request shows failed with the reason. Fix the conflict in your DNS records and approve again.
  • Decline: nothing changes in your DNS. That partner cannot ask again for 7 days.
  • Expiry: a request you do not answer expires 7 days after it was created. Nothing changes in your DNS and nothing is charged. The partner can ask again.
  • Only you can decide, signed in to your account. An agent connection cannot approve or decline a request.
  • API: GET /api/v1/domains/access-requests lists your requests, pending first and newest first, up to 100. GET /api/v1/domains/access-requests/{requestID} returns one with the full plan of changes while it is pending or failed, and its recordsHash. POST /api/v1/domains/access-requests/{requestID}/approve takes {“recordsHash”: ”…”} copied from that GET, and POST /api/v1/domains/access-requests/{requestID}/decline takes no body.
  • Errors: 404 request_not_found, 409 request_changed (the records changed since you reviewed them, so read the request again), 410 request_expired, 409 request_decided (already approved or declined), 409 domain_not_active and 403 agent_decision_forbidden for an agent connection.

Connecting a domain to a project

  • You can connect a domain registered through StackShift (once it is active) or any hostname you control elsewhere.
  • You can attach the apex domain or provide a subdomain like api or www.
  • A project can have several custom domains and exactly one primary. Only a verified domain can be primary. Change the primary from the domain’s menu (Make primary) or with stackshift project-domain primary PROJECT DOMAIN.
  • A domain you bought through StackShift is ready as soon as you connect it: StackShift writes its DNS records for you.
  • A domain hosted elsewhere starts as Waiting for DNS. Prove it belongs to this project with a CNAME to the project address (stackshift project-domain dns-config PROJECT), or with the TXT record shown on the domain (_stackshift-verify.<your domain>), then choose Verify (stackshift project-domain verify PROJECT DOMAIN). It serves your project only once it is verified.
  • An A record alone does not verify a domain, because every project on the same server shares that address. Root domains use an A record for traffic plus the TXT record for proof.
  • Connecting a root domain such as example.com or example.com.ng also adds www.example.com as its own domain on the project. It is verified, routed and gets its certificate separately, and it verifies automatically once the root domain is verified. Subdomains such as api.example.com never get a www address. Untick “Also connect www” to connect only the root domain, and remove the www domain at any time without touching the root.
  • Only domains in the list are served. Each hostname, www included, belongs to exactly one project, and a hostname used by a stack cannot be connected to a project (or the other way round).
  • If a domain’s DNS points at another project’s StackShift address, the domain shows a warning with the exact record to change.
  • A domain that stays unverified for 7 days is released, so another project can claim it.
  • Addresses under the StackShift domain are already your project’s built-in URL and cannot be added as custom domains.
  • From the CLI: project-domain list, create (a hostname: --data '{"hostname":"example.com","include_www":true}'), attach (a StackShift-registered domain: --data '{"domain_id":"…","subdomain":"app"}'; include_www defaults to true for root domains), verify, primary and delete. Agents use the same actions.

Changing a project’s stackshift.cloud address

Every public project gets a free address such as my-app.stackshift.cloud. The owner or an admin can change it in the project’s Settings, under Networking: choose Change next to the free address and type the new name.
  • Use 1 to 50 lowercase letters, numbers and hyphens. It can’t start or end with a hyphen. Names StackShift uses itself, such as api, are reserved.
  • An address is free once no live project uses it, including a project that is still being deleted. If the name you want was taken by a project you just deleted, wait for the delete to finish and try again.
  • StackShift saves the new address and redeploys the live version straight away, with no rebuild. The old address stops working once the redeploy finishes, so update links and webhooks that use it.
  • Custom domains on the project are not affected.
  • Services in the same application that use this project’s address through ${{service.STACKSHIFT_PUBLIC_DOMAIN}}, or a variable built from it, are listed and redeployed so they pick up the new address. Variables with the old address typed in are listed too; change those yourself and redeploy.
  • API: PATCH /api/v1/projects/{projectID}/address with {"subdomain": "new-name"}. It returns the project, the redeploy’s build_id and operation_ids, and the dependent services. Errors: 422 for a name that breaks the rules, 409 when the name is taken or reserved. Agents propose it as project.address.change, and the owner approves it.

Set up DNS with Cloudflare

If your domain’s DNS is on Cloudflare, StackShift can add the records for you instead of you copying them by hand. You connect Cloudflare once for your account, and the same connection works for Mail and for project domains.
  • Where: in the project’s Networking settings, a domain that is Waiting for DNS shows Set up DNS with Cloudflare when its zone is in your connected Cloudflare account. If Cloudflare is not connected yet, choose Connect Cloudflare there and paste an API token with Zone Read and DNS Edit access. StackShift keeps the token encrypted and carries on with the setup straight away.
  • What it adds: exactly the records shown on the domain. A subdomain such as app.example.com gets a CNAME to your project address. A root domain gets an A record to your project’s address and the www companion gets its CNAME in the same step. A domain that is not verified yet also gets its TXT record (_stackshift-verify.<your domain>).
  • Proxy off: the CNAME and A records are created with Cloudflare’s proxy off (DNS only), so StackShift can check the domain and issue its HTTPS certificate. Turning the proxy on later stops the certificate from renewing.
  • Records already there: if Cloudflare already points the name somewhere else (another A, AAAA or CNAME record, or any record on a name that needs a CNAME), StackShift lists those records and changes nothing until you choose Replace and set up DNS. Your other records are left alone.
  • After it runs: writing the records through your Cloudflare token proves the domain is yours, so the domain is verified at once and the status moves to Setting up HTTPS, then Working · HTTPS on when the certificate is live. The page updates by itself.
  • If the domain is not in your connected Cloudflare account, the domain says so and you add the records by hand as before.
  • API: GET /api/v1/dns/cloudflare shows whether Cloudflare is connected, PUT /api/v1/dns/cloudflare with {“api_token”: ”…”, “domain”: “app.example.com”} connects it (the domain must be one of your project or mail domains and in the token’s account), and DELETE /api/v1/dns/cloudflare disconnects it. GET /api/v1/projects/{projectID}/custom-domains/{projectDomainID}/cloudflare returns {connected, zone_found, records, conflicts}. POST to the same path with {“replace_conflicts”: false} adds the records and verifies the domain.
  • Errors: 409 cloudflare_not_connected, 409 cloudflare_records_conflict (with the conflicting records in error.details.conflicts; send replace_conflicts true to replace them), 400 cloudflare_zone_not_found and 503 secrets_unavailable.
  • From the CLI: project-domain cloudflare-status, cloudflare-connect --file - (reads {“api_token”,“domain”} from stdin so the token stays out of your shell history), cloudflare-plan PROJECT DOMAIN, cloudflare-setup PROJECT DOMAIN --data '{"replace_conflicts":false}' and cloudflare-disconnect. Agents use the project.custom_domain.cloudflare_setup action, and replacing existing records always asks you first.

Expected result

The domain is configured to point at the intended StackShift-managed resource.