Octodns: Difference between revisions
imported>Onny Add example usage |
m Category:Networking added |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 27: | Line 27: | ||
directory: ./config | directory: ./config | ||
default_ttl: 3600 | default_ttl: 3600 | ||
enforce_order: | # Records in the zone config don't have to be sorted alphabetically | ||
enforce_order: False | |||
gandi: | gandi: | ||
class: octodns_gandi.GandiProvider | class: octodns_gandi.GandiProvider | ||
token: env/GANDI_TOKEN | |||
zones: | zones: | ||
Line 52: | Line 53: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
GANDI_TOKEN=1234 octodns-sync --config config.yaml --doit | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 58: | Line 59: | ||
* Use OctoDNS as a NixOS module and declare DNS setup declarative https://github.com/Janik-Haag/NixOS-DNS | * Use OctoDNS as a NixOS module and declare DNS setup declarative https://github.com/Janik-Haag/NixOS-DNS | ||
* [[Dnscontrol]], tool to synchronize your DNS to multiple providers from a simple DSL | |||
[[Category:Applications]] | |||
[[Category:Server]] | |||
[[Category:Networking]] |
Latest revision as of 21:01, 1 October 2024
OctoDNS is a powerful tool that allows for easy management of DNS records across multiple providers. It leverages Python to provide a unified interface for various DNS services, simplifying DNS administration tasks.
Installation
Install OctoDNS with additional providers
/etc/nixos/configuration.nix
environment.systemPackages = with pkgs; [
(octodns.withProviders (ps: [
octodns-providers.bind
octodns-providers.powerdns
octodns-providers.hetzner
octodns-providers.gandi
]))
];
Usage
In this example we're going to configure the A
record for the domain example.org
which is managed by the provider Gandi
config.yaml
---
providers:
config:
class: octodns.provider.yaml.YamlProvider
directory: ./config
default_ttl: 3600
# Records in the zone config don't have to be sorted alphabetically
enforce_order: False
gandi:
class: octodns_gandi.GandiProvider
token: env/GANDI_TOKEN
zones:
'*':
sources:
- config
targets:
- gandi
Inside the directory config
we're going to create a file with the DNS zone configuration for example.org
config/example.org.yaml
---
'':
- type: A
value: 8.8.8.8
Apply this configuration to the domain
GANDI_TOKEN=1234 octodns-sync --config config.yaml --doit
See also
- Use OctoDNS as a NixOS module and declare DNS setup declarative https://github.com/Janik-Haag/NixOS-DNS
- Dnscontrol, tool to synchronize your DNS to multiple providers from a simple DSL