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

# fjall domain

> Manage custom domains, Route 53 DNS, and zone files for Fjall applications on AWS.

## Overview

`fjall domain` manages custom domains for your applications. It scaffolds domains, deploys their AWS Route 53 hosted zones, verifies nameserver delegation, and imports or exports DNS records as BIND zone files.

## Usage

```bash theme={null}
fjall domain <subcommand> [domain] [options]
```

## Subcommands

| Subcommand | Argument   | Description                                  |
| ---------- | ---------- | -------------------------------------------- |
| `create`   | `<domain>` | Scaffold a new domain in the project         |
| `deploy`   | `<domain>` | Deploy the domain's Route 53 hosted zone     |
| `verify`   | `<domain>` | Verify nameserver delegation to Route 53     |
| `export`   | `<domain>` | Export DNS records to a BIND zone file       |
| `import`   | `[domain]` | Import a domain from Route 53 or a BIND file |
| `list`     | none       | List all configured domains                  |
| `eject`    | `<domain>` | Eject a domain from Fjall management         |

## Create a domain

Scaffold a new domain in the current project:

```bash theme={null}
fjall domain create example.com
```

Reuse an existing Route 53 hosted zone instead of creating a new one:

```bash theme={null}
fjall domain create example.com --hosted-zone-id Z1234567890ABC
```

| Option                  | Description                      |
| ----------------------- | -------------------------------- |
| `--hosted-zone-id <id>` | Existing Route 53 hosted zone ID |

## Deploy a domain

Deploy the domain's hosted zone and DNS infrastructure to AWS:

```bash theme={null}
fjall domain deploy example.com
```

This subcommand takes no options beyond the domain argument.

## Verify delegation

Check whether the domain's nameservers point to Route 53:

```bash theme={null}
fjall domain verify example.com
```

Print registrar delegation instructions (requires a successful deploy first):

```bash theme={null}
fjall domain verify example.com --show-delegation
```

| Option              | Description                            |
| ------------------- | -------------------------------------- |
| `--show-delegation` | Emit registrar delegation instructions |

## Export DNS records

Export the domain's DNS records to a BIND zone file:

```bash theme={null}
fjall domain export example.com --output ./example.com.zone
```

| Option                  | Description                        |
| ----------------------- | ---------------------------------- |
| `--output <path>`       | Output path for the BIND zone file |
| `--hosted-zone-id <id>` | Explicit Route 53 hosted zone ID   |
| `--force`               | Overwrite an existing output file  |

## Import a domain

Import from an existing Route 53 hosted zone (the default when a domain is given):

```bash theme={null}
fjall domain import example.com --from-route53
```

Import from a BIND zone file:

```bash theme={null}
fjall domain import example.com --from-bind ./example.com.zone
```

| Option                  | Description                                           |
| ----------------------- | ----------------------------------------------------- |
| `--hosted-zone-id <id>` | Route 53 hosted zone ID                               |
| `--from-bind <path>`    | Import from a BIND zone file                          |
| `--from-route53`        | Import from Route 53 (default when a domain is given) |
| `--interactive`         | Collect records via interactive prompts               |
| `--preserve-bind`       | Retain `zone.bind` in the scaffold output             |

## List domains

Show all domains configured in the current project:

```bash theme={null}
fjall domain list
```

## Eject a domain

Remove a domain from Fjall management while keeping its AWS resources in place:

```bash theme={null}
fjall domain eject example.com
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Deploy" icon="rocket" href="/cli/deploy">
    Deploy your application to AWS.
  </Card>

  <Card title="Create" icon="plus" href="/cli/create">
    Scaffold applications, organisations, and accounts.
  </Card>

  <Card title="List resources" icon="list" href="/cli/list">
    List the resources inside an application's infrastructure.
  </Card>

  <Card title="Connect AWS" icon="link" href="/cli/connect">
    Connect an AWS account to deploy into.
  </Card>
</CardGroup>
