Custom domains
Serve your gateway from your own hostname — a custom handle on bazgateway.com, or a subdomain of a domain you own.
Every gateway keeps a permanent Bazantic URL. You can put a better name on it:
- A custom handle, such as
acme.bazgateway.com. This needs no DNS work. - A custom domain, such as
api.acme.com. This needs two DNS records on a domain you own.
When a custom domain is active, Bazantic advertises it as the gateway's URL. The catalog listing, the agent card, the MCP endpoint, and the 402 payment challenges all use that URL. A handle does the same when no custom domain is active.
Your original URL never stops working
While a custom hostname is healthy, every address form serves the same gateway, with the same authentication and payment rules. The slug form stays valid forever, so an agent that pinned it keeps working after you add a domain.
Choose a form
| Custom handle | Custom domain | |
|---|---|---|
| Example | acme.bazgateway.com | api.acme.com |
| DNS work | None | Two records |
| Time to go live | Under a minute | Minutes to hours, because DNS must propagate |
| Where it works | Every environment | Production |
| Certificate | Already in place | Issued for you |
You can hold both. A custom domain wins when both are live.
Claim a custom handle
- Open the gateway in the dashboard.
- Find the Custom handle card.
- Keep the suggested handle, or type a different one.
- Press Claim handle.
The new URL is live within a minute.
A handle is one DNS label. It must obey these rules:
- 3 to 63 characters.
- Lowercase letters, numbers, and hyphens only.
- The first and last character must not be a hyphen.
- It must be unique across Bazantic.
- It must not be a reserved name. Bazantic reserves three classes of names:
- Common infrastructure labels, such as
www,api,mail,auth,login,dev, andstaging. - Bazantic product names, such as
bazantic,askbaz, andgateway. - Major brand names, such as
githubandstripe.
- Common infrastructure labels, such as
Every gateway carries a suggested handle from the day you deploy it. The suggestion is not live until you claim it. Until then the gateway advertises its slug.
Add a custom domain
Before you start, make sure you have these three things:
- A domain that you control.
- Access to the DNS records for that domain.
- The
gateway:writepermission on the account that owns the gateway.
Step 1 — Pick a hostname
Use a subdomain, such as api.acme.com or gateway.acme.com. Bazantic does not serve an
apex domain such as acme.com.
The hostname must be lowercase ASCII. Internationalized domain names are not supported.
Step 2 — Add the domain to the gateway
In the dashboard, open the gateway and find the Custom domain card. Type the hostname and press Add domain.
From the terminal, use the CLI:
baz gateway domains add my-gateway api.acme.comBazantic answers with two DNS records and sets the status to Pending ownership.
Step 3 — Create the two DNS records
Add both records at your DNS provider. Copy the values from the card or from the CLI output. The token is unique to your domain.
| Type | Host | Value |
|---|---|---|
TXT | _baz-challenge.api.acme.com | baz-verify=api.acme.com,<token> |
CNAME | api.acme.com | bazgateway.com |
The TXT record proves that you control the domain. The CNAME record sends traffic to
Bazantic. Both records must stay in place for as long as you use the domain.
Four provider details cause most failures:
- Turn the proxy off. On Cloudflare, set the record to DNS only, the grey cloud.
A proxied record hides the
CNAMEand the check fails. - Watch for an appended zone. Some registrars add the zone to the host you type. If
your provider does this, enter
_baz-challenge.apiand not the full name. - Remove a conflicting
AAAArecord. The hostname must resolve through theCNAMEalone. - Allow the certificate authority. If your zone uses
CAArecords, add0 issue "letsencrypt.org". A zone with noCAArecord needs no change.
Step 4 — Verify the records
Press Verify in the dashboard, or run this command:
baz gateway domains verify my-gatewayBazantic reads your TXT, CNAME, CAA, A, and AAAA records from public resolvers. The
card shows the TXT and CNAME results, and names any A, AAAA or CAA problem.
A new DNS record is not visible everywhere at once. Your provider states a propagation time. If the first check fails, wait and check again. Bazantic also re-checks every pending domain for you every few minutes, so you can leave the page and come back.
Manual verification is limited to six attempts per hour for each hostname. The button shows a countdown when you reach the limit.
Step 5 — Wait for the certificate
When both records pass, the status moves to Pending certificate. Bazantic requests the certificate for you. You do not do anything in this step.
The status becomes Active when the certificate is ready. Your gateway then answers on
https://api.acme.com, and Bazantic advertises that URL.
TLS renewal and recovery
Fly issues and renews the certificate for your hostname. Bazantic does not hold the certificate or its private key. It checks the Fly certificate state and manages the operator response when a renewal is at risk or fails.
A renewal-risk observation does not interrupt traffic. The custom hostname stays active while Fly works to renew its certificate. DNS ownership and TLS health are separate: a domain can have healthy DNS while its certificate needs attention.
If Bazantic confirms that TLS is unavailable, new catalog and dashboard URLs use the gateway's canonical URL until Fly recovers. Bazantic does not redirect requests from the failed custom hostname. A caller or agent that pinned that hostname must wait for Fly to restore its certificate; the original domain claim and DNS records remain in place, and you can repair or remove the claim.
How the certificate is issued
Fly issues a TLS certificate for your hostname through Let's Encrypt. The process runs in this order:
- Your
TXTandCNAMErecords pass the checks in step 4. Bazantic requests no certificate before this point. - Bazantic asks the Fly gateway edge to order a certificate for your exact hostname.
- Let's Encrypt validates the order over HTTP, through the
CNAMErecord you created. You add no further DNS record for the certificate. - The edge installs the certificate. Bazantic reads the certificate state, and moves the domain to Active.
Issuance usually completes in a few minutes. The status stays at Pending certificate until the certificate is ready.
Renewal is automatic. Keep the CNAME record and any CAA record in place, and you do
not touch the certificate again.
The certificate covers the exact hostname you added. It does not cover a wildcard, and it does not cover other names in your zone.
What the statuses mean
| Status | Meaning | Your action |
|---|---|---|
| Pending ownership | Bazantic waits for the TXT record. | Add the TXT record. |
| Pending DNS | Ownership passed. Bazantic waits for the CNAME record, or for a CAA or AAAA problem to clear. | Correct the record the card names. |
| Pending certificate | The records pass. The certificate is on order. | Wait. |
| Active | The hostname serves traffic, and Bazantic advertises it. | None. |
| Temporary failure | A DNS lookup failed. This is usually a resolver problem. | Wait, then press Verify. |
| Degraded | The hostname still serves, but its DNS no longer matches. | Restore the CNAME record. |
| Failed | The setup did not complete. | Remove the domain and add it again. |
A domain that is degraded keeps serving traffic while the certificate is valid. Bazantic releases the domain if the DNS stays wrong for 30 days.
These DNS statuses do not report certificate health. A domain can remain DNS-active while Bazantic watches its TLS renewal separately. If TLS fails, the failed claim stays removable even though Bazantic stops using the custom hostname in new URLs.
A domain that never reaches Active expires after 7 days. Remove it and add it again to get a new token.
Fix a failed check
The card names one reason at a time. The CLI prints the same reason as a code.
| Reason | What to do |
|---|---|
txt_missing | Add the TXT record shown on the card. |
txt_mismatch | The TXT record exists, but the value is wrong. Replace it with the value on the card. |
cname_missing | Add the CNAME record shown on the card. |
cname_wrong_target | The CNAME points somewhere else. Change the target to the value on the card. |
cname_proxied | A proxy intercepts the record. Set the record to DNS only. |
caa_blocks_issuance | Your CAA records block the certificate authority. Add 0 issue "letsencrypt.org". |
aaaa_conflict | Remove the AAAA record for this hostname. |
registrar_autoappend_suspected | Your registrar appends the zone to the host. Enter the short host, such as _baz-challenge.api. |
dns_error_temporary | A resolver did not answer. Press Verify again in a few minutes. |
cert_pending | The certificate is on order. Wait. |
cert_failed | Issuance failed. Contact support@bazantic.com. |
expired_pending | The setup expired after 7 days. Remove the domain and add it again. |
dns_drift | The records changed after the domain went live. Restore the CNAME record. |
Limits
| Limit | Value |
|---|---|
| Custom domains for each gateway | 1 |
| Custom domains for each account | 5 |
| Manual verification for each hostname | 6 each hour |
| Domain changes for each account | 10 each hour |
| Time to complete a setup | 7 days |
Remove a custom domain
Press Remove on the card, or run this command:
baz gateway domains rm my-gatewayThe hostname stops serving traffic within a minute, and Bazantic advertises the previous URL again. Callers that pinned the custom hostname get a TLS error, so publish the change before you remove the domain. This is different from a confirmed TLS failure: in that case Bazantic keeps the claim and DNS records, but uses the canonical URL for new catalog and dashboard links while Fly recovers.
Delete your DNS records too
Bazantic releases its own record and its certificate. It cannot edit your DNS. Delete the
CNAME and the TXT record at your provider. A CNAME that points at a hostname
Bazantic no longer serves resolves to a TLS error. It is also the record another account
needs in place to take the hostname over.
Ownership proof still stands in the way of that takeover. A released hostname is never
served again until somebody proves control of it one more time, with a fresh token in a
new TXT record. To use the hostname again yourself, add it again and repeat step 3.
Do it from the CLI
Every step above has a CLI command. Sign in first with baz login.
baz gateway domains add my-gateway api.acme.com # claim the hostname, print the records
baz gateway domains status my-gateway # status, per-record state, last check
baz gateway domains verify my-gateway # run the checks now
baz gateway domains rm my-gateway --yes # release the hostnameAdd --json to any of these commands for a machine-readable result. See
Command line for the rest of the CLI.