# Domain file

URL: /code/project-structure/domain-definition · Id: `convention:domain-definition`

> A Domain file states what one Domain hosts, where it redirects and which mailboxes it has; registrar and certificate state are observed, never written.

A [Domain](/business/nouns/domain) file states what one Domain hosts, where it redirects and which mailboxes it has; registrar and certificate state are observed, never written.

| Property | Value |
| --- | --- |
| Path | `domains/[host].mdx` |
| Holds | [Domain](/business/nouns/domain) |
| Kind | file |
| Leaders | db-first, git-first |
| Team | [Engineering Team](/agents/engineering) |
| Written by | [Domain.connect](/business/nouns/domain/connect), [Change.merge](/business/nouns/change/merge) |
| Compiled by | [SiteBuilder](/code/builders/site) |

### Example
`domains/closewise.com.mdx` in a Startup repository.

```mdx title="domains/closewise.com.mdx"
---
role: primary
hosts: sites/www
email: { mailboxes: [hello, billing] }
redirects: { www.closewise.com: closewise.com }
---
```

### Props
The frontmatter keys the file takes. The body is its prose.

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | `string` | Yes | What the Domain is for: `primary`, `redirect` or `email`. |
| `hosts` | `string` | No | The Site it serves, by path: `sites/www`. |
| `email` | `json` | No | The mailboxes at the Domain. |
| `redirects` | `json` | No | Hosts that redirect to it. |

### Generates
[SiteBuilder](/code/builders/site) compiles it into these records, Verbs and routes.

| Kind | What |
| --- | --- |
| Records | [Domain](/business/nouns/domain) |
| Verbs | [Domain.connect](/business/nouns/domain/connect) |
| Routes | None. |