# Custom domains

> Hostnames an organization serves its app on: custom domains verified by a DNS TXT record, subdomains of the platform domain, one primary per organization, and resolve_hostname() for the proxy.

- Category: Tenancy & accounts
- Module: `domains`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/domains
- Page: https://bettersupabase.com/blocks/domains

## Install

```bash
npx better-supabase add domains
```

The command also installs `updated-at`, `tenant`, `access`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by domains; add installs them too.
    "updated-at": {},
    tenant: {},
    access: {},
    // Modes: "managed", "custom". The default is "managed".
    domains: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/domains`.

## Events

- `hostname.added`
- `hostname.primary_set`
- `hostname.removed`
- `hostname.verified`

## Related blocks

Requires: [tenant](https://bettersupabase.com/blocks/tenant.md), [access](https://bettersupabase.com/blocks/access.md)

Works with: [reserved-slugs](https://bettersupabase.com/blocks/reserved-slugs.md)
