---
title: "Transfer domains from third-party DNS hosting"
sidebar_label: "Transfer domains from third-party DNS hosting"
description: "How to transfer domains from third-party DNS hosting to Selectel DNS hosting"
sidebar_position: 1
---

import Formbricks from '@theme/MDXComponents/Formbricks'

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'

# Transfer domains from third-party DNS hosting

:::info

This is an instruction for transferring domains from a third-party provider to Selectel DNS hosting (actual) via importing a zone file using octoDNS.

If your current DNS hosting does not provide the ability to download a zone file, but it is supported in octoDNS, you can transfer data directly without downloading the zone file. Learn more about supported providers and working with them in the [octoDNS documentation](https://github.com/octodns/octodns?tab=readme-ov-file#providers), and find an example configuration for transferring in the [Syncing between providers](https://github.com/octodns/octodns?tab=readme-ov-file#syncing-between-providers) section.

:::

1. [Install octoDNS](#install-octodns).
2. [Import a zone file](#import-zone-file).
3. [Delegate the domain to DNS hosting (actual)](#delegate-domain).

## 1. Install octoDNS \{#install-octodns}

1. Install Python 3, virtualenv, and pip3:

   <Tabs queryString="install-components">
     <TabItem value="linux" default>
       <TabItemLabel>
         Linux
       </TabItemLabel>

       ```bash
       sudo apt-get update
       sudo apt-get install python3 virtualenv
       sudo apt-get install python3-pip
       ```
     </TabItem>

     <TabItem value="macos">
       <TabItemLabel>
         macOS
       </TabItemLabel>

       ```bash
       brew install python3
       brew install virtualenv
       ```
     </TabItem>
   </Tabs>

2. Create a directory for working with octoDNS with `config` and `zones` folders:

   ```bash
   mkdir -p ~/octodns/{config,zones}
   ```

3. Go to the `~/octodns` directory:

   ```bash
   cd ~/octodns
   ```

4. Create a virtual environment for working with octoDNS:

   ```bash
   virtualenv env
   ```

5. Activate the virtual environment:

   ```bash
   source env/bin/activate
   ```

6. Install octoDNS into the virtual environment:

   ```bash
   pip3 install octodns
   ```

7. Install the [Selectel provider](https://github.com/octodns/octodns-selectel) for octoDNS:

   ```bash
   pip3 install octodns_selectel
   ```

8. Verify that the Selectel provider is installed correctly:

   ```bash
   pip3 list | grep octodns-selectel
   ```

   The installed version of the provider will appear in the response, for example:

   ```bash
   octodns_selectel 0.99.1
   ```

   The minimum version of the Selectel provider for working with DNS hosting (actual) is 0.99.1.

## 2. Import a zone file \{#import-zone-file}

1. Download the zone file to the `~/octodns/zones` directory.

2. Go to the `~/octodns/zones` directory:

   ```bash
   cd ~/octodns/zones
   ```

3. Rename the downloaded file to your domain name with a dot at the end:

   ```bash
   mv <zone_file.txt> <example.com>.
   ```

   Specify:

   * `<zone_file.txt>` — the name of the zone file you downloaded in step 1;
   * `<example.com>` — the name of your domain.

4. Go to the `~/octodns/config` directory:

   ```bash
   cd ~/octodns/config
   ```

5. Create an `import_config.yaml` configuration file:

   ```bash
   nano import_config.yaml
   ```

6. Write the configuration for importing the zone to the file:

   ```yaml
   ---
   processors:
     no-root-ns:
       class: octodns.processor.filter.IgnoreRootNsFilter
   providers:
       selectel:
           class: octodns_selectel.SelectelProvider
           token: <x_auth_token>
       zonefile:
           class: octodns_bind.ZoneFileSource
           directory: ./zones
           check_origin: false

   zones:
       <example.com>.:
           sources:
           - zonefile
           processors:
           - no-root-ns
           targets:
           - selectel
   ```

   Specify:

   * `<x_auth_token>` — an [IAM token for the project](/api/authorization/#iam-token-project-scoped) to which you need to transfer the data;
   * `<example.com>` — the name of the domain (zone) you need to transfer.

7. Go to the `~/octodns` directory:

   ```bash
   cd ~/octodns
   ```

8. Run the import:

   ```bash
   octodns-sync --config-file=./config/import_config.yaml --doit
   ```

9. In the [Control panel](https://my.selectel.ru/dns/default/hosting/), on the top menu, click **Products** and select **DNS Hosting**.

10. Make sure you are in the project to which you transferred the data. To do this, open the projects menu (the name of the current project) and select the required project.

11. Make sure that the zone has appeared in the list of zones and that the transferred records are displayed on its page.<br />Resource records of the same type are displayed as a group of records.<br />NS and SOA resource records are not transferred; they will be automatically created in DNS hosting (actual) with default values that cannot be edited:

    * NS — `a.ns.selectel.ru.`, `b.ns.selectel.ru.`, `c.ns.selectel.ru.`, `d.ns.selectel.ru`.
    * SOA — `a.ns.selectel.ru. support.selectel.ru.` `<zone_serial_number> 10800 3600 604800 60`, where `<zone_serial_number>` is the serial number of the zone, which changes when the zone is updated and signals caching servers that records need to be re-cached.

    If data was transferred incorrectly or incompletely, [create a ticket](https://my.selectel.ru/tickets/create). Domains that have only NS and SOA records will not be transferred.

## 3. Delegate the domain to DNS hosting (actual) \{#delegate-domain}

1. Go to the control panel of the domain registrar where your domain is registered.
2. In the NS records, replace the values with the NS servers of DNS hosting (actual): `a.ns.selectel.ru`, `b.ns.selectel.ru`, `c.ns.selectel.ru`, `d.ns.selectel.ru`. Each server must be specified in a separate record.
3. Wait for the transferred resource records to propagate to the DNS servers. Propagation can take up to 72 hours.
4. Optional: [check the resource records](/dns-hosting/records/check-records.mdx). If the resource records have not appeared on the authoritative DNS hosting servers after 72 hours: `a.ns.selectel.ru`, `b.ns.selectel.ru`, `c.ns.selectel.ru`, `d.ns.selectel.ru`, [create a ticket](https://my.selectel.ru/tickets/create).

<Formbricks />
