DNScale Now Supports DNSControl: DNS as Code Made Simple
Manage your DNS infrastructure with DNSControl. Define zones and records in JavaScript, preview changes, and push with a single command.
Have you ever wished managing DNS was as easy as dnscontrol push? Now it is.
We're announcing the official DNScale provider for DNSControl, the open-source DNS management tool from StackExchange. This integration lets you define your entire DNS configuration in a JavaScript file, preview changes before applying them, and manage multiple domains from a single source of truth.
Why DNSControl?
DNSControl takes a different approach to DNS-as-code. Instead of HCL or YAML, you write your configuration in plain JavaScript. This gives you real programming constructs ā variables, functions, loops ā while keeping your DNS definitions declarative and readable.
With the DNScale provider, you can:
- Write DNS as JavaScript - Use variables, functions, and macros to eliminate repetition
- Preview before applying - See exactly what will change before it goes live
- Support multiple providers - DNSControl works with dozens of DNS providers, making migrations straightforward
- Track changes in Git - Your
dnsconfig.jsis your DNS documentation - Automate with CI/CD - Run
previewon pull requests,pushon merge
What You Can Manage
The DNScale provider supports all 14 DNS record types available on the platform: A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, PTR, SRV, SSHFP, SVCB, TLSA, and TXT.
Zones
Zones are created automatically when you run dnscontrol push. No separate setup step required:
D("myapp.com", REG_NONE, DnsProvider(DSP_DNSCALE),
A("@", "203.0.113.10")
);Records
Define any record type with a clean, readable syntax:
D("myapp.com", REG_NONE, DnsProvider(DSP_DNSCALE),
A("api", "203.0.113.10", TTL(300)),
AAAA("api", "2001:db8::10", TTL(300)),
CNAME("www", "myapp.com."),
MX("@", 10, "mail.myapp.com."),
TXT("@", "v=spf1 include:_spf.google.com ~all"),
CAA("@", "issue", "letsencrypt.org")
);Quick Start
Getting started takes three steps.
1. Configure credentials ā create creds.json:
{
"dnscale": {
"TYPE": "DNSCALE",
"api_key": "your-api-key-here"
}
}2. Define your DNS ā create dnsconfig.js:
var REG_NONE = NewRegistrar("none");
var DSP_DNSCALE = NewDnsProvider("dnscale");
D("example.com", REG_NONE, DnsProvider(DSP_DNSCALE),
A("@", "192.0.2.1"),
A("www", "192.0.2.1"),
MX("@", 10, "mail.example.com."),
TXT("@", "v=spf1 include:_spf.google.com ~all")
);3. Preview and push:
dnscontrol preview # See what would change
dnscontrol push # Apply the changesThat's it. Your zone is created, records are configured, and everything is defined in a file you can commit to Git.
Real-World Use Cases
Multi-Domain Management
Manage dozens of domains from one file using JavaScript variables and functions:
var MAIL_SERVERS = [
MX("@", 10, "mx1.mailprovider.com."),
MX("@", 20, "mx2.mailprovider.com.")
];
D("company.com", REG_NONE, DnsProvider(DSP_DNSCALE),
A("@", "192.0.2.1"),
MAIL_SERVERS
);
D("company.org", REG_NONE, DnsProvider(DSP_DNSCALE),
A("@", "192.0.2.1"),
MAIL_SERVERS
);Migrating from Other Providers
DNSControl supports dozens of DNS providers. You can migrate to DNScale incrementally by changing the provider declaration while keeping your record definitions unchanged.
CI/CD Integration
Run dnscontrol preview on pull requests to catch DNS misconfigurations before they reach production. Merge to main to trigger dnscontrol push automatically.
How It Works
The DNScale provider communicates with the DNScale REST API using your API key. When you run dnscontrol push:
- DNSControl reads your
dnsconfig.jsconfiguration - The provider fetches current records from the DNScale API
- A diff is computed between desired and current state
- Only the necessary changes (creates, updates, deletes) are applied
This diff-based approach means you can safely run push repeatedly ā if nothing changed in your config, nothing changes in your DNS.
Get Started Today
- Learning Guide: Managing DNS with DNSControl
- DNSControl Docs: docs.dnscontrol.org
- DNSControl GitHub: github.com/StackExchange/dnscontrol
If you don't have a DNScale account yet, sign up and grab your API key from the dashboard. Your first zone is on us.
What's Next
This initial release covers the full DNScale feature set. We're planning:
- Expanded documentation and migration guides
- More CI/CD examples for GitLab CI, Bitbucket Pipelines, and others
- Community contributions upstream to the DNSControl project
Have feedback? Reach out to our team or open an issue on the DNSControl repository.
DNS-as-code doesn't need to be complicated. With DNSControl and DNScale, you get a JavaScript config file, a preview-before-push workflow, and support for every record type. Your DNS configuration finally gets the same treatment as everything else in your stack: versioned, reviewed, automated, and reliable.
dnscontrol push your DNS today.