2017-01-11 13:02:45 -07:00
---
layout: default
---
# Getting Started
## 1. Get the binaries
You can either download the latest [github release ](https://github.com/StackExchange/dnscontrol/releases ), or build from the go source:
`go get github.com/StackExchange/dnscontrol`
## 2. Create files
The first file you will need is a javascript file to describe your domains.
Individual providers will vary slightly. See [the provider docs ]({{site.github.url}}/provider-list ) for specifics.
2017-03-22 10:38:08 -06:00
For this example we will use a single "BIND" provider that will generate zone files on our local file system.
2017-01-11 13:02:45 -07:00
The default name is `dnsconfig.js` :
{% highlight js %}
2017-03-22 10:38:08 -06:00
var registrar = NewRegistrar("none","NONE"); // no registrar
var bind = NewDnsProvider("bind","BIND");
2017-01-11 13:02:45 -07:00
2017-03-22 10:38:08 -06:00
D("example.com", registrar, DnsProvider(bind),
2017-01-11 13:02:45 -07:00
A("@", "1.2.3.4")
);
{%endhighlight%}
2017-03-22 10:39:36 -06:00
You may modify this file to match your particular providers and domains. See [the javascript docs ]({{site.github.url}}/js ) and [the provider docs ]({{site.github.url}}/provider-list ) for more details. If you are using other providers, you will likely need to make a `creds.json` file with api tokens and other account information.
2017-01-11 13:02:45 -07:00
## 3. Run `dnscontrol preview`
This will print out a list of "corrections" that need to be performed. It will not actually make any changes.
## 4. Run `dnscontrol push`
2017-03-22 10:38:08 -06:00
This will actually generate `zones/example.com.zone` for you. The bind provider is more configurable, and you can read more information [here. ]({{site.github.url}}/providers/bind )
2017-04-13 12:46:47 -04:00
# Migrate more zones
Once you have the system working for a test zone, migrate other
zones. You can manually create the `D()` statements, or you can
generate them automatically using the
[convertzone ](https://github.com/StackExchange/dnscontrol/blob/master/misc/convertzone/README.md )
utility that is included in the DNSControl repo (it converts
BIND-style zone files to DNSControl's language). To make sure the
migration is correct, use `dnscontrol preview` and make sure it
sees no differences.
2017-04-18 13:14:27 -04:00
[Migrating ]({{site.github.url}}/migrating ) doc gives more detailed advice.