# Use a domain on an endpoint

Serve a name of a verified domain on an endpoint of another service, and see where each domain is used.

An endpoint serves a name of a domain: the domain's own name, or, for a domain that covers every
name one level under it, any such name (`orders.apps.example.com`, not
`a.orders.apps.example.com`). Each name is served by one endpoint on the whole platform.

## Prerequisites

- A verified domain that covers the name (see [Add and verify a domain](add-and-verify-a-domain.md)).
- Permission for `domains:UseDomain` on the domain, and the permission the endpoint's own service
  asks for to change the endpoint.
- To see where a domain is used in the console, `domains:ListDomains` to open **Domains** and
  `domains:GetDomain` to open the domain.

## Give an endpoint a name

Each service that can serve your own domain says how on its own pages. Asking for a name that no
verified domain of your organization covers is refused with `400`, and a name another endpoint
already serves with `409`.

## See where a domain is used

**Console**
1. Open **Domains** and choose the domain.
2. Under **Used by**, each name is listed with its service and resource.

**CLI**
```sh
dcloud domains domains get apps.example.com
```

**API**
```http
GET /domains/api/domains/apps.example.com
```

The answer's `attachments` lists the name, the service, the resource's name and its resource name.

## Related

- [Delete a domain](delete-a-domain.md)
- [Security](security.md)
