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

BIND: Improve SOA serial number handling (#651)

* github.com/miekg/dns
* Greatly simplify the logic for handling serial numbers. Related code was all over the place. Now it is abstracted into one testable method makeSoa. This simplifies code in many other places.
* Update docs/_providers/bind.md: Edit old text. Add SOA description.
* SOA records are now treated like any other record internally. You still can't specify them in dnsconfig.js, but that's by design.
* The URL for issue 491 was wrong in many places
* BIND: Clarify GENERATE_ZONEFILE message
This commit is contained in:
Tom Limoncelli
2020-02-23 13:58:49 -05:00
committed by GitHub
parent 3c41a39252
commit 9812ecd9ff
60 changed files with 708 additions and 254 deletions

View File

@@ -12,7 +12,8 @@ Both of those tasks are different at each site, so they are best done by a local
## Configuration
In your credentials file (`creds.json`), you can specify a `directory` where the provider will look for and create zone files. The default is the `zones` directory where dnscontrol is run.
The BIND provider does not require anything in `creds.json`. However
you can specify a `directory` where the provider will look for and create zone files. The default is the `zones` directory (in the current directory).
{% highlight json %}
{
@@ -22,7 +23,9 @@ In your credentials file (`creds.json`), you can specify a `directory` where the
}
{% endhighlight %}
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:
The BIND accepts some optional metadata via your DNS config when you create the provider:
In this example we set the default SOA settings and NS records.
{% highlight javascript %}
var BIND = NewDnsProvider('bind', 'BIND', {
@@ -43,4 +46,24 @@ var BIND = NewDnsProvider('bind', 'BIND', {
})
{% endhighlight %}
If you need to customize your SOA or NS records, you can do so with this setup.
## SOA Records
DNSControl assumes that SOA records are managed by the provider. Most
providers simply generate the SOA record for you and do not permit you
to control it at all. The BIND provider is unique in that it must emulate
what most DNS-as-a-service providers do.
When DNSControl reads a BIND zonefile:
* If there was no SOA record, one is created using the `default_soa`
settings listed above.
* When generating a new zonefile, the SOA serial number is
updated.
DNSControl ties to maintain the serial number as yyyymmddvv. If the
existing serial number is significantly higher it will simply
increment the value by 1.
If you need to edit the SOA fields, the best way is to edit the
zonefile directly, then run `dnscontrol preview` and `dnscontrol push`
as normal.