1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Update bind docs and Getting Started (#53)

* intitial work for bind refactor

* relax requirement that creds.json exists.

* Updating bind docs.
Fixes #48

* typo

* can exclude provider from default set in creds.json

* Add bind to integration tests. Fix for IDNs.
This commit is contained in:
Craig Peterson
2017-03-22 10:38:08 -06:00
committed by GitHub
parent 33b4d2b748
commit 854c84e652
8 changed files with 98 additions and 84 deletions

View File

@@ -6,4 +6,31 @@ jsId: BIND
# Bind Provider
This provider simply maintains a directory with a collection of .zone files. We currently copy zone files to our production servers and restart bind via
a script external to DNSControl.
a script external to DNSControl.
## Configuration
The BIND provider does not require anything in `creds.json`. It does accept some (optional) metadata via your dns config when you create the provider:
{% highlight javascript %}
var bind = NewDnsProvider('bind', 'BIND', {
'default_soa': {
'master': 'ns1.mydomain.com.',
'mbox': 'sysadmin.mydomain.com.',
'refresh': 3600,
'retry': 600,
'expire': 604800,
'minttl': 1440,
},
'default_ns': [
'ns1.mydomain.com.',
'ns2.mydomain.com.',
'ns3.mydomain.com.',
'ns4.mydomain.com.'
]
})
{% endhighlight %}
If you need to customize your SOA or NS records, you can do it with this setup.
You can also provide a `-bindtree=directoryName` flag to change where the provider will look for and create zone files. The default is the `zones` directory where dnscontrol is run.

View File

@@ -13,30 +13,19 @@ You can either download the latest [github release](https://github.com/StackExch
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.
For this example we will use a domain registered with name.com, using their basic dns hosting.
For this example we will use a single "BIND" provider that will generate zone files on our local file system.
The default name is `dnsconfig.js`:
{% highlight js %}
var registrar = NewRegistrar("name.com",NAMEDOTCOM);
var namecom = NewDnsProvider("name.com",NAMEDOTCOM);
var registrar = NewRegistrar("none","NONE"); // no registrar
var bind = NewDnsProvider("bind","BIND");
D("example.com", registrar, DnsProvider(namecom),
D("example.com", registrar, DnsProvider(bind),
A("@", "1.2.3.4")
);
{%endhighlight%}
The second file is a json document to hold your api credentials. By default we use `providers.json`:
{% highlight json %}
{
"name.com":{
"apikey": "yourApiKeyFromName.com-klasjdkljasdlk235235235235",
"apiuser": "yourUsername"
}
}
{%endhighlight%}
You may modify these files to match your particular providers and domains. See [the javascript docs]({{site.github.url}}/js) for more details.
You may modify this files 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.
## 3. Run `dnscontrol preview`
@@ -44,4 +33,4 @@ This will print out a list of "corrections" that need to be performed. It will n
## 4. Run `dnscontrol push`
This will actually perform the required changes with the various providers.
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)