OctoDNS provides a set of tools and patterns that make it easy to manage your DNS records across multiple providers. The resulting config can live in a repository and be deployed just like the rest of your code, maintaining a clear history and using your existing review and workflow.
One of the requirements to use the OctoDNS plugin for ClouDNS is to have access to our HTTP API. All our Premium DNS and DDoS Protected DNS plans include access to the HTTP API and can be used to manage your zones with OctoDNS.
Install OctoDNS. You can download OctoDNS from here or you can install it using this command
pip install octodns
Install OctoDNS module for ClouDNS from here or you can install it using this command
pip install octodns-cloudns
The ClouDNS module has to be moved to the provider folder of OctoDNS. In order to do that, you have to complete these two steps:
Find where the downloaded files are with this command:
pip show octodns | grep Location
Open the folder you have received from the first command. There should be two folders one for octodns and one for octodns-cloudns. Copy the file _init_.py from octodns-cloudns and put it in the octodns folder named provider.
Create a configuration file. For example config.yaml
providers:
cloudns_account1:
class: octodns.provider.cloudns.ClouDNSProvider
auth_id: xxx
auth_password: xxx
config:
class: octodns.provider.yaml.YamlProvider
directory: ./config
default_ttl: 3600
zones:
example.com.:
sources:
- config
targets:
- cloudns_account1
providers - write all of the settings for the providers.
zones - write the name of the zone after which you have to add:
sources - where the information will be received from.
targets - in which provider will the changes be made
You have to create a file with the records which will be added. In this example, the records will be in the provider config directory - ./config
Create a new directory with this command:
mkdir config
Create a file with the name of the zone + .yaml. Example: example.yaml
Add the records in the newly created file. Example records:
---
'':
- type: A
value: your-server-ipv4-address
- type: AAAA
value: your-server-ipv6-address
- type: MX
value:
exchange: mail.your-domain.
preference: 10
- type: TXT
value: v=spf1 -all
_dmarc:
type: TXT
value: v=DMARC1\; p=reject\; rua=mailto:abuse@your-domain\; aspf=s\; adkim=s\;
mail:
- type: A
value: your-server-ipv4-address
- type: AAAA
value: your-server-ipv6-address
www:
- type: A
value: your-server-ipv4-address
- type: AAAA
value: your-server-ipv6-address
Apply the configuration with these commands:
Apply only a plan without updating the zone:
octodns-sync --config-file config.yaml
Apply all the changes:
octodns-sync --config-file config.yaml --doit
If there are NS records that have to be created for the root domain, --force has to be added to the last command.