> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up custom domains from the CLI

> Attach a custom domain to a Square Cloud website, read the DNS records to create, and list every domain and shared domain of your account from the terminal.

A custom domain takes two steps: attach it to the application with `app network domain`, then create the DNS records that `app network dns` prints at your DNS provider. The help center has a [step-by-step custom domain guide](https://help.squarecloud.app/en-us/article/how-to-set-up-your-own-domain-cnamedns-1fzbrgh/) and explains [why a domain can take a while to propagate](https://help.squarecloud.app/en-us/article/why-hasnt-my-domain-propagated-yet-dns-f5jzoy/).

`[appID]` and `--app` are optional: see [how the CLI finds your app](/en/cli-reference/quickstart#how-the-cli-finds-your-app).

## `squarecloud app network domain`

```bash Usage theme={"system"}
squarecloud app network domain <hostname> [--app <appID>]
```

Sets the custom domain of the application, replacing the previous one. Custom domains are available on the Standard, Pro and Enterprise plans. To remove the custom domain, pass `@` as the hostname.

```bash theme={"system"}
squarecloud app network domain www.example.com
```

```bash Output theme={"system"}
✓ Custom domain www.example.com configured successfully
Run 'squarecloud app network dns' to see the DNS records you need to create.
```

## `squarecloud app network dns`

```bash Usage theme={"system"}
squarecloud app network dns [appID] [--json]
```

Prints the DNS records to create for the custom domain, with the type, name, value and status of each one. Without a custom domain, it says to configure one first.

## `squarecloud app domains`

```bash Usage theme={"system"}
squarecloud app domains [--json]
```

Lists every domain configured across all your applications: hostname, type and the ID of the application that owns it.

## `squarecloud app load-balancers`

```bash Usage theme={"system"}
squarecloud app load-balancers [--json]
```

**Aliases:** `lb`

Lists the custom domains attached to more than one application (load balancers), grouped by hostname, with the ID, name and cluster of each application sharing the domain. It starts with how many applications per domain your plan allows.

```bash theme={"system"}
squarecloud app lb --json
# Prints the raw load balancer list as JSON.
```

## Related

| Command | API | JavaScript SDK |
| - | - | - |
| `network domain` | [`POST .../network/custom`](/en/api-reference/endpoint/apps/network/custom) | [`api.apps.network.setDomain()`](/en/sdks/js/network) |
| `network dns` | [`GET .../network/dns`](/en/api-reference/endpoint/apps/network/dns) | [`api.apps.network.dns()`](/en/sdks/js/network) |
| `domains` | [`GET /v2/apps/domains`](/en/api-reference/endpoint/apps/domains) | [`api.apps.domains()`](/en/sdks/js/managing_application) |
| `load-balancers` | [`GET /v2/apps/load-balancers`](/en/api-reference/endpoint/apps/network/load-balancers) | [`api.apps.loadBalancers()`](/en/sdks/js/managing_application) |

Traffic, errors and cache of a website are on [Edge analytics](/en/cli-reference/edge-analytics).
