Custom domains
A web portal can also answer at a name of your own, such as app.example.com, besides
its https://<name>.agent-app.eu address. AgentSpaces gets a certificate for it from
Let’s Encrypt and renews it; you create two DNS records and keep them.
Add one
In the console, open Web portals, the portal, then its
Domains tab (organization owners and admins). Press Add domain and enter the
domain. The tab lists one row per address with its state, the portal’s own agent-app.eu
address last; click a row for its records and its buttons. Or with the CLI:
space portals domains add <portal> <domain>

<portal> is the portal’s name, its generated name (quiet-harbor) or its id. Up to 5
domains per portal. A name with Unicode characters is converted to its xn-- form, and
shown in both forms. Names under agent-app.eu, agent-spaces.eu and polder-vm.eu, IP
addresses and wildcards (*.example.com) can’t be custom domains, and a name can belong to
one portal only.
The portal’s first custom domain turns its Spacebar off: a custom domain is usually production. Turn it on again to have the bar on every address, custom domains included.
The two records
Create both at your DNS provider; a domain’s row on the Domains tab and space portals domains add show them with the values filled in:
| Purpose | Type | Name | Value |
|---|---|---|---|
| Routing, a subdomain | CNAME | app.example.com | <name>.agent-app.eu, or the primary domain |
| Routing, a zone’s apex | A | example.com | the region’s edge address (shown) |
| Ownership | TXT | _agentspaces.app.example.com | asp-verify=<token> |

- Subdomain or apex. A name like
app.example.comgets a CNAME. The apex of a zone (example.com,example.co.uk) can’t have a CNAME: it gets an A record, or an ALIAS or ANAME record pointing at<name>.agent-app.euwhere your DNS provider has those. An A record names the region’s address: if the portal ever moves to another region, you change it; a CNAME follows on its own. - CNAME to the primary. Once the portal has a custom domain as its
primary host, the tab tells the portal’s other subdomains to point their
CNAME at that domain (
www.example.com CNAME app.example.com), so they follow wherever it points. A CNAME to<name>.agent-app.eukeeps working too. - The TXT record proves the domain is yours. Its token belongs to this portal and this domain. Without it, a CNAME left behind after you delete a portal could be claimed by someone else. Keep it as long as you use the domain.
- No AAAA record. The region is reached over IPv4 only, so the name needs no AAAA record. Remove any AAAA record the name (or the domain its CNAME names) already has, such as a parking page’s from your DNS provider: Let’s Encrypt and visitors would follow it elsewhere.
- CAA records: if your zone has CAA records, one must allow
letsencrypt.org, or the certificate can’t be issued.
States
The portal checks the records itself, often at first and then less often, for 72 hours;
Check now in the domain’s row, or space portals domains check <portal> <domain>, looks at once.
It asks public resolvers, so a record your provider just saved can take a few minutes (its
TTL) to show.
| State | Meaning |
|---|---|
waiting for DNS (pending_dns) | One of the records isn’t there yet; the domain’s row says which. |
| verified | Both are there: the region orders the certificate next. |
getting a certificate (issuing) | Let’s Encrypt checks the domain over http:// (port 80). |
| active | Served over HTTPS. The certificate renews itself a month before it ends. |
certificate failed (failed) | The reason is shown, with the record to fix (Let’s Encrypt found no address for the name, CAA forbids Let’s Encrypt, the domain doesn’t reach us over port 80, a rate limit); the region tries again after an hour, then less often. |
certificate expired (expired) | Renewals failed until the certificate ran out: not served until one succeeds. |
A domain’s row shows each record with a check or a cross: what the last check found.
Check now on a failed or expired domain whose records are both there also orders its certificate again at once, rather than after the region’s wait. That is the fix when Let’s Encrypt found no address for the name: it asks its own resolvers, which can still have the answer from before you created the record (for up to an hour, the zone’s negative TTL).
The portal checks every domain’s records once an hour as well. When they are wrong, the organization gets an alert (on its Alerts page) and the domain’s row says DNS records wrong:
- the routing record (CNAME or A) of a served domain is gone: the name no longer reaches the portal (critical);
- its TXT record is gone: if it stays gone for 14 days, the domain goes back to waiting for DNS and is no longer served;
- a domain still waits for its records 72 hours after it was added.
The alert clears by itself once the records are right, or when you remove the domain.
Plain http:// on an active domain redirects to https://. Nothing but the certificate
checks and that redirect is answered on port 80; your service never sees plain HTTP.
Primary host
Without a primary host, every address serves the portal, and each keeps its own sign-ins:
someone signed in at app.example.com signs in again at <name>.agent-app.eu. Make one
address the primary (Make primary in its row on the tab, or space portals domains primary <portal> <host>) and the others redirect to it, path and query kept: one address,
one sign-in. The primary is the portal’s agent-app.eu address or one of its verified
domains; No primary host on the tab, or --none, removes it.
The portal’s first custom domain becomes its primary by itself once it is verified, when
the portal has no primary yet; the redirect starts when its certificate is active.

space portals domains primary <portal> <host>
space portals domains primary <portal> --noneSign-in with Google and Microsoft works on a custom domain without registering anything new: the redirect URI stays the region’s one.
Remove one
Remove in the domain’s row on the tab, or:
space portals domains remove <portal> <domain>The portal stops answering there at once and the name is free again. If it was the primary
host, the portal has none afterwards. Remove the DNS records too, but first point the CNAME
of any other domain that names it at <name>.agent-app.eu (or the new primary), or those
stop resolving.