Infrastructure as code for DNS!
DNSControl
DNSControl is Infrastructure as Code for DNS. It includes a full-featured configuration language (Javascript-compatible), plus "plug-ins" that speak to DNS provider APIs such as AWS Route 53, Cloudflare, and Gandi. It can send the same DNS records to multiple providers. It runs anywhere Go runs (Linux, macOS, Windows). The provider model is extensible, so more providers can be added.
An Example
dnsconfig.js:
// define our registrar and providers
var REG_NAMECOM = NewRegistrar("name.com");
var r53 = NewDnsProvider("r53")
D("example.com", REG_NAMECOM, DnsProvider(r53), A("@", "1.2.3.4"), CNAME("www","@"), MX("@",5,"mail.myserver.com."), A("test", "5.6.7.8") )
Running dnscontrol preview will talk to the providers (here name.com as registrar and route 53 as the dns host), and determine what changes need to be made.
Running dnscontrol push will make those changes with the provider and my dns records will be correctly updated.
The easiest way to run DNSControl is to use the Docker container:
docker run --rm -it -v "$(pwd):/dns" ghcr.io/dnscontrol/dnscontrol preview
See Getting Started page on documentation site to get started!
Supported Providers
DNSControl supports 64 DNS providers and registrars:
| | | | | | | ----- | ----- | ----- | ----- | ----- | | AdGuard Home | Akamai Edge DNS | Alibaba Cloud DNS | AutoDNS | AWS Route 53¹ | | AXFR+DDNS | Azure DNS | Azure Private DNS | BIND | Bunny DNS | | CentralNic Reseller¹ | Cloudflare | ClouDNS | CSC Global¹ | deSEC | | DigitalOcean | DNS Made Easy | DNSOVERHTTPS² | DNScale | DNSimple¹ | | Domainnameshop | Dynadot² | easyname² | Exoscale | Fortigate | | Gandi¹ | Gcore | Gidinet¹ | Google DNS | Hetzner | | hosting.de¹ | Huawei Cloud DNS | Hurricane Electric DNS | Infomaniak | Internet.bs² | | INWX¹ | Joker | Linode | Loopia¹ | LuaDNS | | Windows Server DNS | MikroTik RouterOS | Mythic Beasts | Name.com¹ | Namecheap¹ | | Netcup | Netlify | Netnod | NS1 | OpenSRS² | | Oracle Cloud | OVH¹ | Packetframe | Porkbun¹ | PowerDNS | | Realtime Register¹ | RWTH DNS-Admin | Sakura Cloud | SoftLayer | Tencent Cloud DNS¹ | | TransIP | UniFi Network | Vercel | Vultr | Netbird | | WebSupport | | | | |
¹also supports registrar functions ²registrar only
Stack Overflow uses this system to manage hundreds of domains and subdomains across multiple registrars and DNS providers.
You can think of it as a DNS compiler. The configuration files are written in a DSL that looks a lot like JavaScript. It is compiled to an intermediate representation (IR). Compiler back-ends use the IR to update your DNS zones on services such as Route53, Cloudflare, and Gandi, or systems such as BIND.
Benefits
- Less error-prone than editing a BIND zone file.
- More reproducible than clicking buttons on a web portal.
- Easily switch between DNS providers: The DNSControl language is
- Apply CI/CD principles to DNS! StackOverflow maintains their
- Adopt (GitOps) PR-based updates. Allow developers to send updates as PRs,
- Variables save time! Assign an IP address to a constant and use the
- Macros! Define your SPF records, MX records, or other repeated data
- Control Cloudflare from a single source of truth. Enable/disable
- Keep similar domains in sync with transforms and other features. If
- It is extendable! All the DNS providers are written as plugins.
Installation
DNSControl can be installed via packages for macOS, Linux and Windows, or from source code. See the official instructions.
Via GitHub Actions (GHA)
See dnscontrol-action or gacts/install-dnscontrol.
Deprecation warnings (updated 2025-11-21)
- REV() will switch from RFC2317 to RFC4183 in v5.0. This is a breaking change. Warnings are output if your configuration is affected. No date has been announced for v5.0. See https://docs.dnscontrol.org/language-reference/top-level-functions/revcompat
- NAMEDOTCOM, OPENSRS, and SOFTLAYER need maintainers! These providers have no maintainer. Maintainers respond to PRs and fix bugs in a timely manner, and try to stay on top of protocol changes. Interested in being a hero and adopting them? Contact tal at what exit dot org.
Contributing
Want to contribute? Whether it's fixing a bug, adding a new DNS provider, or improving documentation, contributions are welcome. See CONTRIBUTING.md for how to get started.
More info at our website
The website: https://docs.dnscontrol.org/
The getting started guide: https://docs.dnscontrol.org/getting-started/getting-started