Skip to Content
CLI & APICommand reference

stackblaze domain

Add, verify, list, or remove custom domains for an app

Usage: stackblaze domain|domains [options] [command]

Add, verify, list, or remove custom domains for an app

Options:
  --api-url <url>             StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>             API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>        Project name
  -e, --env <name>            Environment name (default: production)
  -a, --app <name>            App name
  --json                      Output JSON (same as -o json) (default: false)
  -o, --output <format>       Output format: text or json (choices: "text",
                              "json")
  -h, --help                  Print help

Commands:
  list|ls [options]           List the app's domains with verification and
                              certificate status
  add [options] <host>        Add a custom domain and print the DNS records
                              (TXT + CNAME) to create
  verify [options] <host>     Check DNS now and advance the domain (DNS records
                              → edge → HTTPS certificate)
  remove|rm [options] <host>  Remove a custom domain (detaches it from the app
                              and its HTTPS certificate)
  status [options] [host]     Show ingress hosts, TLS, and the project wildcard

domain list

Usage: stackblaze domain list|ls [options]

List the app's domains with verification and certificate status

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

List an app's domains: its platform hostname and any custom domains, with verification and certificate status.

stackblaze domain list -p github-demo-cw8z -e dev -a hello-web
OK github-demo-cw8z/dev/hello-web-qw6y
┌───────────────────────────────────────────────────┬──────────┬─────────────────┬─────────────┐
│ Host                                              │ Type     │ Status          │ Certificate │
├───────────────────────────────────────────────────┼──────────┼─────────────────┼─────────────┤
│ hello-web-qw6y.cloud-dev-central-1.stackblaze.app │ platform │ active          │ ready       │
├───────────────────────────────────────────────────┼──────────┼─────────────────┼─────────────┤
│ shop.example.com                                  │ custom   │ waiting for DNS │ pending     │
└───────────────────────────────────────────────────┴──────────┴─────────────────┴─────────────┘
shop.example.com: TXT _stackblaze-verify.shop.example.com not found; CNAME shop.example.com → fkzcqciuasaoyxoc.edge.stackblaze.cloud not found
shop.example.com: Not verified yet. Until it is, other accounts can claim this domain too: the first claim whose TXT record verifies gets it, and the other claims are released.

domain add

Usage: stackblaze domain add [options] <host>

Add a custom domain and print the DNS records (TXT + CNAME) to create

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --wait                 Keep verifying until the domain is active (HTTPS
                         ready) (default: false)
  --timeout <seconds>    Max --wait time (default: 600)
  --interval <seconds>   Seconds between checks while waiting (default: 10)
  --takeover             The domain is verified by another account that no
                         longer controls its DNS: claim it; it moves here once
                         your TXT record is live and theirs has been gone for
                         consecutive checks (≥10 min) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Add a custom domain to an app. The CLI prints the two DNS records to create at your DNS provider.

stackblaze domain add shop.example.com -p github-demo-cw8z -e dev -a hello-web
OK Added shop.example.com to github-demo-cw8z/dev/hello-web-qw6y
Create these DNS records at your DNS provider:
┌───────┬─────────────────────────────────────┬────────────────────────────────────────────────────┬───────┐
│ Type  │ Name                                │ Value                                              │ Found │
├───────┼─────────────────────────────────────┼────────────────────────────────────────────────────┼───────┤
│ TXT   │ _stackblaze-verify.shop.example.com │ stackblaze-verify=3d4addb81a98383f5bc0688f8423c1fe │ no    │
├───────┼─────────────────────────────────────┼────────────────────────────────────────────────────┼───────┤
│ CNAME │ shop.example.com                    │ fkzcqciuasaoyxoc.edge.stackblaze.cloud             │ no    │
└───────┴─────────────────────────────────────┴────────────────────────────────────────────────────┴───────┘
Not verified yet. Until it is, other accounts can claim this domain too: the first claim whose TXT record verifies gets it, and the other claims are released.
Then run `stackblaze domain verify shop.example.com` (or add --wait) — the platform also re-checks every 5 minutes.

domain verify

Usage: stackblaze domain verify [options] <host>

Check DNS now and advance the domain (DNS records → edge → HTTPS certificate)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  --wait                 Keep verifying until the domain is active (HTTPS
                         ready) (default: false)
  --timeout <seconds>    Max --wait time (default: 600)
  --interval <seconds>   Seconds between checks while waiting (default: 10)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Exit code: 0 only when the domain is active (DNS verified and HTTPS ready);
1 while it is still pending (DNS, edge or certificate), on error, or when
--wait times out. The JSON document (--json) is printed either way.

Example

Check a domain's DNS now. Until both records are found it stays pending, and the command exits with 1; add --wait to keep checking until HTTPS is ready.

stackblaze domain verify shop.example.com -p github-demo-cw8z -e dev -a hello-web
shop.example.com  waiting for DNS  cert: pending
TXT _stackblaze-verify.shop.example.com not found; CNAME shop.example.com → fkzcqciuasaoyxoc.edge.stackblaze.cloud not found
Not verified yet. Until it is, other accounts can claim this domain too: the first claim whose TXT record verifies gets it, and the other claims are released.
┌───────┬─────────────────────────────────────┬────────────────────────────────────────────────────┬───────┐
│ Type  │ Name                                │ Value                                              │ Found │
├───────┼─────────────────────────────────────┼────────────────────────────────────────────────────┼───────┤
│ TXT   │ _stackblaze-verify.shop.example.com │ stackblaze-verify=3d4addb81a98383f5bc0688f8423c1fe │ no    │
├───────┼─────────────────────────────────────┼────────────────────────────────────────────────────┼───────┤
│ CNAME │ shop.example.com                    │ fkzcqciuasaoyxoc.edge.stackblaze.cloud             │ no    │
└───────┴─────────────────────────────────────┴────────────────────────────────────────────────────┴───────┘
shop.example.com is not active yet (waiting for DNS). Run `stackblaze domain verify shop.example.com --wait` to wait for it.

domain remove

Usage: stackblaze domain remove|rm [options] <host>

Remove a custom domain (detaches it from the app and its HTTPS certificate)

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -y, --yes              Skip the confirmation prompt (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Remove a custom domain from an app. Type yes to confirm, or pass -y.

stackblaze domain remove shop.example.com -p github-demo-cw8z -e dev -a hello-site
!  Removing shop.example.com from github-demo-cw8z/dev/hello-web-qw6y detaches it from the app and stops serving HTTPS for it; visitors using it will get errors until it is added again.
Type "yes" to continue: yes
OK Removed domain shop.example.com from github-demo-cw8z/dev/hello-web-qw6y

domain status

Usage: stackblaze domain status [options] [host]

Show ingress hosts, TLS, and the project wildcard

Options:
  --api-url <url>        StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>        API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>   Project name
  -e, --env <name>       Environment name (default: production)
  -a, --app <name>       App name
  --json                 Output JSON (same as -o json) (default: false)
  -o, --output <format>  Output format: text or json (choices: "text", "json")
  -h, --help             Print help

Example

Show whether the app's ingress is on and which hosts it serves.

stackblaze domain status -p github-demo-cw8z -e dev -a hello-web
OK github-demo-cw8z/dev/hello-web-qw6y
ingress: enabled
  hello-web-qw6y.cloud-dev-central-1.stackblaze.app  no tls record

A custom domain shows up here once it is verified; until then, check it with stackblaze domain list.

On this page