---
title: "Add DNS record"
sidebar_label: "Add DNS record"
sidebar_position: 2
description: "How to add a DNS record"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Add DNS record

If a network is connected to a zone, A or AAAA records in the zone are added automatically when a port is created in the network. Such records are marked with the **Auto** tag. A or AAAA records can also be added manually. CNAME, MX, and TXT records can only be added manually.

For a domain name, only one record of each type can exist. If you don't have a resource record of the required type for the domain name yet, [add a record](#add-record). If you already have a record of the required type for the domain name, [add a value to it](#add-value-to-record).

If a network is connected to a zone and you have added an A or AAAA record for a domain name manually, and then created a port with this domain name, the port's IP address will be automatically added to this record as an additional value. The record will be marked with the **Auto** tag, and it will begin changing automatically when port data changes.

You can check if a network is connected to a zone in the [control panel](https://my.selectel.ru/vpc/default/private-dns/): from the top menu, click **Products** → **Cloud Servers** → **Private DNS** → **DNS Resolvers** tab → network row → **DNS Zone** field.

## Add record \{#add-record}

<Tabs queryString="add-record">
  <TabItem value="a" default>
    <TabItemLabel>
      A or AAAA
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), from the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, click **Add record**.
    5. Select the record type — A or AAAA.
    6. Enter the domain name for which the record will be created. The domain of the zone where you are creating the record will be added to it automatically.
    7. Enter the IP addresses that will be associated with the domain name: IPv4 addresses for an A record, and IPv6 addresses for an AAAA record. You can specify no more than 100 IP addresses. Enter the addresses separated by a comma or a space, or on a new line.
    8. Enter the record TTL in seconds. To apply the zone TTL, enter `-1` or click **Use zone TTL**. TTL is the time during which a resource record in the NS server cache is considered valid and does not require re-caching.
    9. Click **Add**.
  </TabItem>

  <TabItem value="cname">
    <TabItemLabel>
      CNAME
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), from the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, click **Add record**.
    5. Select the record type — CNAME.
    6. Enter the domain alias — the domain name that should translate to the target domain. The domain of the zone where you are creating the record will be added to it automatically.
    7. Enter the target domain name to which the alias should translate. It can be any domain name in FQDN format, with a trailing dot.
    8. Enter the record TTL in seconds. To apply the zone TTL, enter `-1` or click **Use zone TTL**. TTL is the time during which a resource record in the NS server cache is considered valid and does not require re-caching.
    9. Click **Add**.
  </TabItem>

  <TabItem value="mx">
    <TabItemLabel>
      MX
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), from the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, click **Add record**.
    5. Select the record type — MX.
    6. Enter the domain name for which the record will be created. The domain of the zone where you are creating the record will be added to it automatically.
    7. Enter the priority and mail server name separated by a space, for example `10 mail.example.com`. Priority is a number from 0 to 65535; the lower the number, the higher the priority. The mail server name must be in the zone domain.
    8. Optional: to add another mail server, click **+** and enter the priority and server name. You can add no more than 100 mail servers.
    9. Enter the record TTL in seconds. To apply the zone TTL, enter `-1` or click **Use zone TTL**. TTL is the time during which a resource record in the NS server cache is considered valid and does not require re-caching.
    10. Click **Add**.
  </TabItem>

  <TabItem value="txt">
    <TabItemLabel>
      TXT
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), from the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, click **Add record**.
    5. Select the record type — TXT.
    6. Enter the domain name for which the record will be created. The domain of the zone where you are creating the record will be added to it automatically.
    7. Enter the record value — any text not exceeding 255 characters.
    8. Optional: to add another value, click **+** and enter the record value. You can add no more than 100 values.
    9. Enter the record TTL in seconds. To apply the zone TTL, enter `-1` or click **Use zone TTL**. TTL is the time during which a resource record in the NS server cache is considered valid and does not require re-caching.
    10. Click **Add**.
  </TabItem>
</Tabs>

## Add value to record \{#add-value-to-record}

You can add a value to A, AAAA, MX, and TXT records. A CNAME record can contain only one value.

<Tabs queryString="add-record">
  <TabItem value="a" default>
    <TabItemLabel>
      A or AAAA
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), from the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, in the row of the required A or AAAA record, click <MoreVerticalIcon /> and select **Edit record**.
    5. In the **IPv4 address** or **IPv6 address** field, enter the additional IP address that will be associated with the domain name. You can specify no more than 100 IP addresses. Separate the addresses with a comma, a space, or by placing each address on a new line.
    6. Click **Save**.
  </TabItem>

  <TabItem value="mx">
    <TabItemLabel>
      MX
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, in the row of the required MX record, click <MoreVerticalIcon /> and select **Edit record**.
    5. Click **+** and enter the priority and the mail server name separated by a space, for example `10 mail.example.com`. The lower the number, the higher the priority. The mail server name must be in the same zone as the record domain name. You can add no more than 100 mail servers.
    6. Click **Save**.
  </TabItem>

  <TabItem value="txt">
    <TabItemLabel>
      TXT
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/vpc/default/private-dns/), on the top menu, click **Products** and select **Cloud Servers**.
    2. Go to the **Private DNS** section.
    3. Open the zone page.
    4. In the **Records** block, in the row of the required TXT record, click <MoreVerticalIcon /> and select **Edit record**.
    5. Click **+** and enter the record value — any text of no more than 255 characters. You can add no more than 100 values.
    6. Click **Save**.
  </TabItem>
</Tabs>

<Formbricks />
