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

# Configure OctoDNS with Gcore Managed DNS

OctoDNS is an open-source tool that manages DNS zones across multiple providers — use it to synchronize records from a primary DNS provider to Gcore Managed DNS, keeping Gcore as a secondary DNS with an up-to-date copy of zone data.

Before starting, verify that the primary DNS provider is supported by checking the [providers table](https://github.com/octodns/octodns#providers). If the provider is not listed, automatic record transfer is not supported.

## Install OctoDNS

<Info>
  Steps 2–11 run in a terminal on the machine where OctoDNS will be installed — a local laptop or any Linux server works. The commands below are for Debian/Ubuntu; for other operating systems, install Python 3 and create a virtual environment using the method appropriate for that system.
</Info>

<Steps>
  <Step title="Create a DNS zone for the domain to synchronize">
    In the [Gcore Customer Portal](https://portal.gcore.com), navigate to **DNS** and create a [DNS zone](/dns/manage-a-dns-zone) for the domain to synchronize. If the zone already exists, skip this step.

    <Frame>
      <img src="https://mintcdn.com/gcore/W9hLxFUXyZVjy-WH/images/docs/dns/dns-plugins/use-gcore-dns-as-a-secondary-dns-with-octodns/dns-zones-list.png?fit=max&auto=format&n=W9hLxFUXyZVjy-WH&q=85&s=b52c444691027a4cd65f48bc4e488c19" alt="All zones page in the Gcore Customer Portal" width="1400" height="616" data-path="images/docs/dns/dns-plugins/use-gcore-dns-as-a-secondary-dns-with-octodns/dns-zones-list.png" />
    </Frame>
  </Step>

  <Step title="Update the local package index">
    ```sh theme={null}
    sudo apt update
    ```
  </Step>

  <Step title="Install Python 3 and the venv module">
    ```sh theme={null}
    sudo apt install python3 python3-venv
    ```
  </Step>

  <Step title="Create a working directory for OctoDNS">
    ```sh theme={null}
    mkdir ~/octodns ~/octodns/config
    ```
  </Step>

  <Step title="Navigate to the working directory">
    ```sh theme={null}
    cd ~/octodns
    ```
  </Step>

  <Step title="Create and activate a Python virtual environment">
    ```sh theme={null}
    python3 -m venv venv
    source venv/bin/activate
    ```

    Keep the virtual environment active for all remaining steps.
  </Step>

  <Step title="(Optional) Install Git">
    ```sh theme={null}
    sudo apt-get install git-all
    ```
  </Step>

  <Step title="Install OctoDNS and the provider packages">
    Replace `octodns_yourprovider` with the module name for the primary DNS provider found in the providers table:

    ```sh theme={null}
    pip install octodns octodns_gcore octodns_yourprovider
    ```

    Verify the installation:

    ```sh theme={null}
    octodns-sync --version
    ```

    Expected output (version number varies):

    ```
    octoDNS x.x.x
    ```

    If the command is not found, the virtual environment is not active. Run `source venv/bin/activate` from the `~/octodns` directory and retry.
  </Step>

  <Step title="Navigate to the config directory">
    ```sh theme={null}
    cd ~/octodns/config
    ```
  </Step>

  <Step title="Create config.yaml">
    This file specifies the providers and DNS zones for OctoDNS to manage. YAML indentation is required — use the template below as a starting point:

    ```yaml theme={null}
    providers:
      [your provider name]:
        [your provider class]
        [authentication data]
      gcore:
        class: octodns_gcore.GCoreProvider
        [authentication data]
    zones:
      [your DNS zone].:
        sources:
          - [your provider name]
        targets:
          - gcore
    ```

    **Gcore DNS provider configuration**

    The Gcore DNS provider requires authentication. An [API token](/account-settings/api-tokens) is recommended:

    ```yaml theme={null}
    gcore:
      class: octodns_gcore.GCoreProvider
      token: YOUR_API_TOKEN
      token_type: APIKey
    ```

    Alternatively, login and password authentication is supported:

    ```yaml theme={null}
    gcore:
      class: octodns_gcore.GCoreProvider
      login: your_login
      password: your_password
    ```

    **Primary provider configuration**

    Each provider has its own configuration format. In the providers table, find the primary provider, open its repository, and locate the **Configuration** section to copy the provider name, class name, and authentication fields.

    With Amazon Route 53 as the primary provider, the full `config.yaml` looks like this:

    ```yaml theme={null}
    providers:
      route53:
        class: octodns_route53.Route53Provider
        access_key_id: YOUR_KEY_ID
        secret_access_key: YOUR_SECRET_KEY
      gcore:
        class: octodns_gcore.GCoreProvider
        token: YOUR_API_TOKEN
        token_type: APIKey
    zones:
      myzone.com.:
        sources:
          - route53
        targets:
          - gcore
      mymyzone.com.:
        sources:
          - route53
        targets:
          - gcore
    ```

    Save and close the file.
  </Step>

  <Step title="Verify with a dry-run sync, then apply">
    A dry-run shows the planned changes without applying them:

    ```sh theme={null}
    octodns-sync --config-file=~/octodns/config/config.yaml
    ```

    Example output:

    ```
    * gcore (GCoreProvider)
    *   Create <ARecord A 300, www.myzone.com., ['1.2.3.4']> (route53)
    *   Summary: Creates=1, Updates=0, Deletes=0, Existing=0, Meta=False
    ```

    If the output is correct, apply the changes:

    ```sh theme={null}
    octodns-sync --config-file=~/octodns/config/config.yaml --doit
    ```

    Example output:

    ```
    INFO    GCoreProvider[gcore] apply: making 1 changes to myzone.com.
    INFO    GCoreProvider[gcore] creating: Create <ARecord A 300, www.myzone.com., ['1.2.3.4']> (route53)
    INFO    Manager sync:   1 total changes
    ```

    The synchronized records are visible in the Customer Portal under **DNS** → the zone name.

    <Frame>
      <img src="https://mintcdn.com/gcore/W9hLxFUXyZVjy-WH/images/docs/dns/dns-plugins/use-gcore-dns-as-a-secondary-dns-with-octodns/dns-zone-records.png?fit=max&auto=format&n=W9hLxFUXyZVjy-WH&q=85&s=c8f664847909076e94305ff0735d6ae3" alt="DNS zone records in the Gcore Customer Portal" width="1059" height="686" data-path="images/docs/dns/dns-plugins/use-gcore-dns-as-a-secondary-dns-with-octodns/dns-zone-records.png" />
    </Frame>
  </Step>
</Steps>

## Update records

To re-sync records after changes in the primary provider:

<Steps>
  <Step title="Navigate to the OctoDNS directory and activate the virtual environment">
    ```sh theme={null}
    cd ~/octodns
    source venv/bin/activate
    ```
  </Step>

  <Step title="Run the sync command">
    ```sh theme={null}
    octodns-sync --config-file=~/octodns/config/config.yaml --doit
    ```
  </Step>
</Steps>

To automate record updates, schedule this command with cron.
