Docs / Guides

Custom domains

Serve a claimed project at a domain you bought elsewhere, like www.example.com, with HTTPS.

Every service has an AgentServe URL. Once a project is claimed you can also serve any of its services at a domain you own, bought from any registrar. HTTPS is set up for you. The AgentServe URLs keep working too.

Add the domain#

  1. Open the project in the console and go to Domains.
  2. Enter the hostname, for example www.example.com or example.com, and pick the service it should serve. Usually that's the frontend.
  3. The domain is added as pending, and the page shows the two DNS records to create.

Create the DNS records#

The console looks up where your domain's DNS is hosted and shows the steps for that provider: its own field names, the name to type (www, not www.example.com), a link straight to its DNS settings, and the default records it's known to add that get in the way. If it guesses wrong, pick your provider from the menu. The records are always these two:

TypeNameValueWhy
TXT_agentserve.www.example.comagentserve-verify=<token> Proves you control the domain. The token is shown in the console.
CNAMEwww.example.comdomains.agentserve.sh Sends the traffic to AgentServe.

Most providers want the name without the domain at the end: _agentserve.www and www. A root domain (example.com) can't have a CNAME at most providers. Use the A records the console shows instead, or an ALIAS/ANAME record or CNAME flattening if your provider has one. If you use Cloudflare for your domain, set the CNAME to DNS only (grey cloud).

One-click setup#

Some providers support Domain Connect. When yours does, the console shows Set up automatically: you approve the change on the provider's site, it creates both records, and you land back on the Domains page, which picks them up within a minute. Nothing is changed until you approve, and only these two records are touched.

Provider notes#

Where the console's steps come from. Every provider below adds the domain to the name itself.

ProviderFieldsRoot isRoot domain viaWatch out for
CloudflareName / Target / Content@CNAMESet Proxy status to DNS only (grey cloud), or the certificate can't be issued. A CNAME on @ is fine at Cloudflare: it's flattened automatically.
GoDaddyName / Value (Points to)@A recordNew GoDaddy domains come with an A record on @ named Parked and a CNAME www → @. Delete the first, and edit the second instead of adding another. Leave domain forwarding off: it replaces your records.
NamecheapHost / Value@ALIASDelete the default CNAME www → parkingpage.namecheap.com and URL Redirect Record. Records live under Advanced DNS, in Host records.
Squarespace Domains (formerly Google Domains)Host / Data@A recordAdd them under Custom records, and delete the Squarespace Defaults preset if it's there. Using Google Cloud DNS directly? Same nameservers: edit the zone in the Cloud console instead.
Amazon Route 53Record name / ValueemptyA recordThe console wants TXT values in double quotes: "agentserve-verify=…". Open the hosted zone for the domain. Keep Simple routing and leave Alias off.
PorkbunHost / AnsweremptyALIASOpen the domain's DNS panel. Delete the default ALIAS → pixie.porkbun.com and CNAME * → pixie.porkbun.com records first.
DigitalOceanHostname / Value (Is an alias of, for CNAME)@A recordNo surprises.
HostingerName / Points to@A recordDelete the default A record on @ and the CNAME on www that point at Hostinger's parking page.
IONOSHost name / Points to@A recordOpen the domain, then DNS. IONOS offers to delete conflicting records when you save: accept.
OVHcloudSubdomain / TargetemptyA recordNo surprises.
GandiName / Value@ALIASOpen the domain, then DNS Records.
Name.comHost / AnsweremptyANAMENo surprises.
HoverHostname / Value@A recordNo surprises.
VercelName / ValueemptyALIASNo surprises.
DNSimpleName / ContentemptyALIASNo surprises.
NameSiloHostname / ValueemptyA recordNo surprises.
WixHost Name / Value@A recordNo surprises.
Azure DNSName / Value@A recordNo surprises.

When something's off#

The console checks the records while the page is open and says what it found, in words:

  • Waiting for the TXT record: it isn't visible yet. Check the name (_agentserve.www for www.example.com) and that the value is pasted whole.
  • Proxied by Cloudflare: the record has the orange cloud on. Switch it to DNS only.
  • Also resolves to …: an old A or AAAA record is still there, often the registrar's parking page. Delete it, or some visitors land on the old address.
  • Points at …, not at AgentServe: the CNAME or A record still has an old value, or the record is missing and a wildcard answers instead.

Verification and HTTPS#

While the Domains page is open it checks every few seconds and updates itself. Otherwise pending domains are checked every 30 seconds for the first hour, then every 10 minutes for a week. DNS changes take anywhere from a minute to a few hours to show up.

As soon as the TXT record is found the domain is verified and serves the service. The certificate is issued on the first HTTPS visit, which takes a few seconds; after that it renews on its own. The console also says whether the domain points at AgentServe yet, so you can tell a missing CNAME from a missing TXT record.

Keep the TXT record: it's how a domain is reclaimed. If another project, yours or someone else's, proves control of the same hostname later, the domain moves there. That way a domain that changed hands is never stuck on an old project.

Changing and removing#

  • Pick another service from the menu next to the domain to point it there. The change is immediate.
  • The trash icon stops serving the domain right away. Deleting the project removes all its domains.
  • A project can have up to 10 domains.

Your app sees the custom hostname in the Host and X-Forwarded-Host headers. ${svc.url} references in the manifest keep resolving to the AgentServe URLs.

From the API#

The same steps work with the owner's API key (or the agent's manage token, once the project is claimed). See Custom domains in the HTTP API reference.

curl -s -X POST "$AGENTSERVE/v0/stacks/stk_3f9a1c0b2d4e/domains" \
  -H "Authorization: Bearer $AGENTSERVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname": "www.example.com", "service": "web"}'
Stuck? Your agent can read /skill.md, or connect it over MCP.