[Yandex Cloud documentation](../index.md) > [Yandex Cloud DNS](index.md) > Getting started

# How to get started with Cloud DNS


Create [DNS zones](concepts/dns-zone.md), add `A` records for your test [VMs](../compute/concepts/vm.md), and test domain name resolution.

## Getting started {#before-begin}

1. Log in to the [management console](https://console.yandex.cloud) or sign up. If not signed up yet, navigate to the management console and follow the on-screen instructions.
1. On the [**Yandex Cloud Billing**](https://center.yandex.cloud/billing/accounts) page, make sure you have a linked [billing account](../billing/concepts/billing-account.md) with the `ACTIVE` or `TRIAL_ACTIVE` status. If you do not have a billing account yet, [create one](../billing/quickstart/index.md#create_billing_account).
1. If you do not have a [folder](../resource-manager/concepts/resources-hierarchy.md#folder) yet, [create one](../resource-manager/operations/folder/create.md). While creating a folder, you can also create a default [virtual network](../vpc/concepts/network.md#network) with [subnets](../vpc/concepts/network.md#subnet) in all [availability zones](../overview/concepts/geo-scope.md).
1. [Create a network](../vpc/quickstart.md) and subnets for your test VMs.
1. [Create](../compute/operations/vm-create/create-linux-vm.md) VMs named `test-vm-1` and `test-vm-2` in the `ru-central1-a` availability zone. Make sure `test-vm-1` has a [public IP address](../vpc/concepts/address.md#public-addresses). Connect them to subnets within the same network.

## Create a private DNS zone {#create-private-zone}

Domain zones will store [resource records](concepts/resource-record.md).

Create a new domain zone:

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the **Cloud DNS** section in the folder where you need to create a DNS zone.
  1. Click **Create zone**.
  1. Configure the DNS zone as follows:
     1. **Zone**: `testing`.
     1. **Type**: `Internal`.
     1. **Name**: `test-zone`.
     1. **Networks**: Network hosting your VMs.
  1. Click **Create**.

- CLI {#cli}

  Run this command:

  ```bash
  yc dns zone create --name test-zone \
  --zone testing. \
  --private-visibility network-ids=<network_ID>
  ```

  Where `--private-visibility` is the ID of the network with your test VMs.

{% endlist %}

### Add resource records to your private DNS zone {#add-private-resource-records}

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the list of zones and select `test-zone`.
  1. Select **Records** in the left-hand menu.
  1. Click **Create record**. Configure the record as follows:
     1. **Name**: `test-vm-1`.
     1. **Type**: `A`.
     1. **TTL (in seconds)**: `600`.
     1. **Data**: `test-vm1` [internal IP address](../vpc/concepts/address.md#internal-addresses).
  1. Click **Create**.
  1. Click **Create record** once again. Configure another record:
     1. **Name**: `test-vm-2`.
     1. **Type**: `A`.
     1. **TTL (in seconds)**: `600`.
     1. **Data**: `test-vm2` internal IP address.
  1. Click **Create**.

- CLI {#cli}

  Run the following commands:

  ```bash
  yc dns zone add-records --name test-zone \
  --record "test-vm-1 600 A <VM_internal_IP_address>"
  ```

  Where `--record` is the record containing the `test-vm-1` internal IP address.

  ```bash
  yc dns zone add-records --name test-zone \
  --record "test-vm-2 600 A <VM_internal_IP_address>"
  ```

  Where `--record` is the record containing the `test-vm-2` internal IP address.

{% endlist %}

### Test domain name resolution in the private DNS zone {#test-private-resolving}

Connect to `test-vm-1` over SSH:

```bash
ssh <VM_public_IP_address>
```

On your VM, try accessing `test-vm-2` using its [domain name](../vpc/concepts/address.md#fqdn):

```bash
host test-vm-2.testing.
```

Make sure the response returns the IP address of the appropriate VM:

```bash
host test-vm-2.testing.
test-vm-2.testing has address 10.0.0.9
```

## Create a public DNS zone {#create-public-zone}

If you have a registered domain name, you can create a public domain zone and add a record to it. In this example, we will use `example.com` as the domain name.

Create a new public domain zone:

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the **Cloud DNS** section in the folder where you need to create a DNS zone.
  1. Click **Create zone**.
  1. Configure the DNS zone as follows:
     1. **Zone**: `example.com.`.
     1. **Type**: `Public`.
     1. **Name**: `test-public-zone`.
  1. Click **Create**.

- CLI {#cli}

  Run this command:

  ```bash
  yc dns zone create --name test-public-zone \
  --zone example.com. \
  --public-visibility
  ```

{% endlist %}

### Add resource records to the public zone {#add-public-resource-records}

{% list tabs group=instructions %}

- Management console {#console}

  1. Open the list of zones and select `test-public-zone`.
  1. Select **Records** in the left-hand menu.
  1. Click **Create record**. Configure the record as follows:
     1. **Name**: `www`.
     1. **Type**: `A`.
     1. **TTL (in seconds)**: `600`.
     1. **Data**: `test-vm-1` public IP address.
  1. Click **Create**.

- CLI {#cli}

  Run this command:

  ```bash
  yc dns zone add-records --name test-public-zone \
  --record "www 600 A <VM_public_IP_address>"
  ```

  Where `--record` is the record containing the `test-vm-1` public IP address.

{% endlist %}

Delegate your domain name by specifying the addresses of the Yandex Cloud `ns1.yandexcloud.net.` and `ns2.yandexcloud.net.` name servers at your registrar.

### Test domain name resolution in the public DNS zone {#test-public-resolving}

Make sure the created record resolves to the VM's public IP address. Run the following command on your computer:

```bash
host www.example.com ns1.yandexcloud.net.
```

Result:

```text
Using domain server:
Name: ns1.yandexcloud.net.
Address: 84.201.185.208#53
Aliases:

www.example.com has address <test-vm-1_public_IP_address>
```