---
title: "Get started"
description: "Create a zone, add records and point a new domain at its nameservers, with the console, the ezgh CLI or the API."
---

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

# Get started

This creates a zone for a domain that isn't live anywhere yet, adds its records and points the
domain at the zone's nameservers. For a domain that's already answering from another DNS provider,
follow [Move a domain with no downtime](/dns/move-a-domain) instead.

In the [console](https://console.ezghcloud.com/dns), **Create zone** takes the domain, and the zone's
page walks you through the same steps. The rest of this page uses the CLI and the API.

## Before you start

- **The `ezgh` CLI**, [signed in](/cli/authentication), with a project selected. The commands take
  `--project`, or `EZGH_PROJECT`.
- **`DnsFullAccess`** on the project, or the root user.
- **Access to the domain's registrar**, to set its nameservers.

## 1. Create a zone

```sh
ezgh dns zones create example.com
```

```text
ID:           0199f000-0000-7000-8000-0000000000a1
Slug:         zon_4k2m9x0a7qpe
Domain:       example.com
Status:       pending
Nameservers:  abcd2345.ns1.ezghdns.org, abcd2345.ns2.ezghdns.org
TXT name:     _ezgh-challenge.example.com
TXT value:    mfrggzdfmztwq2lknnwg23tpobyxe43u
```

The zone is `pending`, and doesn't answer yet. With the API, this is
[CreateZone](/dns-api/CreateZone/):

```sh
curl -sS -X POST "https://dns-api.ezghcloud.com/v1/organizations/$ORG_ID/projects/$PROJECT_ID/zones" \
  -H "Authorization: Bearer $EZGH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "domain": "example.com" }'
```

## 2. Add records

Records can be added while a zone is pending, so everything answers from its first moment.

```sh
ezgh dns records set example.com @ A 192.0.2.10 --ttl 300
ezgh dns records set example.com www CNAME example.com.
ezgh dns records set example.com @ MX "10 mail.example.com." "20 mail2.example.com." --ttl 3600
ezgh dns records list example.com
```

`@` is the zone itself. Each `set` replaces what's at that name and type. See [Records](/dns/records).

## 3. Set the domain's nameservers

At your registrar, set the domain's nameservers to the zone's two. Use exactly those two: they're
what ties the domain to your zone. A registrar can take from minutes to a few hours to publish
the change.

## 4. Check that it's live

Checks run on their own, and this runs one now:

```sh
ezgh dns zones verify example.com
```

Within seconds of the status becoming `active`, the zone answers:

```sh
dig +short A example.com @abcd2345.ns1.ezghdns.org
```

## Next

- [Turn on DNSSEC](/dns/dnssec).
- See `ezgh dns --help`, or the [CLI reference](/cli/reference/dns).

Source: https://docs.ezghcloud.com/dns/get-started/index.mdx
