# A and AAAA Records

An `A` record maps a name to an IPv4 address. An `AAAA` record maps a name to an IPv6 address. Use these records to point a name to your server.

## Fields

| Field | Example | Notes |
| --- | --- | --- |
| Name | `@` or `www` | Relative to the zone. `@` is the apex. |
| Type | `A` / `AAAA` |  |
| Content | `203.0.113.10` | An IPv4 (`A`) or IPv6 (`AAAA`) address |
| TTL | `14400` | Seconds. Default 4 hours. |

## Create

Console (zone-file view):

```text
@   A     203.0.113.10        14400
www A     203.0.113.10        14400
ipv6 AAAA 2001:db8::10        14400
```

CLI:

```bash
zcp dns record-create --domain examplecom --name @    --type A    --content 203.0.113.10
zcp dns record-create --domain examplecom --name www  --type A    --content 203.0.113.10
zcp dns record-create --domain examplecom --name ipv6 --type AAAA --content 2001:db8::10
```

API: `POST` with `{ "name": "www", "type": "A", "content": "203.0.113.10", "ttl": 14400 }`. See [Manage DNS with the API](https://docs.zcp.zsoftly.ca/public-cloud/dns/api/#add-a-record).

## Verify

```bash
dig A    www.example.com  +short   # 203.0.113.10
dig AAAA ipv6.example.com +short   # 2001:db8::10
```

## Notes

- Apex and IP address. Point the apex (`@`) at a fixed IP with an `A` or `AAAA` record. Do not use a `CNAME` at the apex. See [CNAME](https://docs.zcp.zsoftly.ca/public-cloud/dns/records/cname).
- Several addresses per name. A name holds several `A` records and several `AAAA` records. Creating a second `A` record at the same name adds it to the set. Publish round-robin `A` records this way. The same applies to `AAAA`. See [Several values per name and type](https://docs.zcp.zsoftly.ca/public-cloud/dns/records#several-values-per-name-and-type).
- Dual stack. Publish both an `A` and an `AAAA` record for a name to serve IPv4 and IPv6 clients. The types differ, so the two records coexist.

See also: [CNAME](https://docs.zcp.zsoftly.ca/public-cloud/dns/records/cname), [Worked examples](https://docs.zcp.zsoftly.ca/public-cloud/dns/examples), [Record types](https://docs.zcp.zsoftly.ca/public-cloud/dns/records)
