---
title: "Put your app on your custom domain, over HTTPS, with while.sh"
url: https://while.sh/en/guides/custom-domain/
author: "Aloïs Oddon, co-founder of Nextmap"
updated: 2026-11-02
---

# Put your app on your own domain name, over HTTPS, from your AI agent

Your app runs on its while.sh address, and you want it on yours. Ask your AI agent: it declares the domain, gives you the DNS records to add, and the HTTPS certificate follows.

## Prerequisites

- An app deployed on while.
- A domain name, and access to its DNS zone at your registrar: Gandi, Cloudflare, Infomaniak…
- Your AI agent, connected to while over MCP.

## Step 1: Ask your agent for your domain

> You, to your agent: Put the app on planning.acme.com.

Your agent adds the domain to the service, in while.yaml:

```yaml titre="while.yaml"
services:
  - name: web
    domains: [planning.acme.com]
```

## Step 2: Add the DNS records

Your agent gives you two records: a TXT record, which proves the domain is yours, and a CNAME to `edge.while.cloud` (source 1). You add them at your registrar. The domain is checked every five minutes. Once it is verified, your agent deploys the app again, and it is served over HTTPS at your address.

## What your agent does

The HTTPS certificate is obtained on the first visit, then renewed without you. Your visitors reach the same version of your app, whichever address they use.

## Put the app on your root domain

> You, to your agent: Put the app on acme.com, without www.

A root domain can't take a CNAME. If your DNS host supports it, it takes an ALIAS (or ANAME) record to `edge.while.cloud`. Otherwise, your agent gives you the A and AAAA addresses to add, along with the TXT proof.

## Follow the DNS verification

> You, to your agent: Is the domain ready?

Your agent reads the domain's status in while, whether the proof was found or the certificate obtained, and tells you what to fix.

## Add a second domain

> You, to your agent: Add www.acme.com too.

Your agent adds the domain to the list, and you add its DNS records the same way.

## Next steps

- [Deploy a static site](/en/guides/deploy-static-site/)
- [Deploy a Next.js app](/en/guides/deploy-nextjs/)
- [Show your app with a link and a password](/en/guides/share-app-with-password/)

## Sources

1. [Cloudflare, what is a CNAME record](https://www.cloudflare.com/learning/dns/dns-records/dns-cname-record/), 2026-11-02

## Questions

### How long before my domain works?

A few minutes: the time it takes for the records to propagate, for the domain to be verified, and then for your agent to deploy the app again.

### Do I have to pay for the HTTPS certificate?

No, it's included, and it renews without you.

### Can I keep my registrar?

Yes. You add two records there, three for a root domain, and nothing more.
