# Zones and records

> Each domain's zone, the record types, and editing them by command, API or file.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://domains.docs.sypnia.com/dns/zones-and-records/

For agents: Domains zones: four Route 53 name servers across TLDs; record types A, AAAA, ALIAS (apex to hostname e.g. Run app), CNAME, MX, TXT, CAA, SRV, NS, PTR; records ls/set (--ttl)/rm; changes applied as one batch, live in ~1 minute (set waits); history with who/where (console, CLI, API, agent, connection), records undo <change-id>; export/import zone file with preview of changes.

Each domain has a **zone** with its records, served by four Route 53 name servers spread over different top-level domains, so one failing does not take the domain down.

| Type               | For                                                                                                |
| ------------------ | -------------------------------------------------------------------------------------------------- |
| `A`, `AAAA`        | an address (IPv4, IPv6)                                                                            |
| `ALIAS`            | the apex (`laespiga.co`) pointing at a hostname, such as a Run app, where a `CNAME` is not allowed |
| `CNAME`            | a subdomain pointing at another name                                                               |
| `MX`               | where e-mail for the domain goes                                                                   |
| `TXT`              | verifications, SPF, DMARC                                                                          |
| `CAA`              | which certificate authorities may issue for the domain                                             |
| `SRV`, `NS`, `PTR` | services, delegating a subdomain, reverse lookups                                                  |

```bash
npx @sypnia/domains records ls laespiga.co
npx @sypnia/domains records set laespiga.co www CNAME laespiga.co --ttl 300
npx @sypnia/domains records rm laespiga.co old TXT
```

## Changes

Each change is applied as one batch and is live on every name server in about a minute; `records set` waits for that and says so. The zone keeps a history of every change, who made it and from where (console, CLI, API, an agent, a connection), and `records undo <change-id>` reverts one.

## Records as a file

`domains records export laespiga.co > zone.txt` writes the zone in the standard zone-file format, and `records import` applies a file, showing what will be added, changed and removed before doing it.
