github.com/teknogeek/dnscontrol/v2@v2.10.1-0.20200227202244-ae299b55ba42/docs/_providers/bind.md (about) 1 --- 2 name: BIND 3 title: BIND Provider 4 layout: default 5 jsId: BIND 6 --- 7 # BIND Provider 8 This provider maintains a directory with a collection of .zone files. 9 10 This provider does not generate or update the named.conf file, nor does it deploy the .zone files to the BIND master. 11 Both of those tasks are different at each site, so they are best done by a locally-written script. 12 13 14 ## Configuration 15 The BIND provider does not require anything in `creds.json`. However 16 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). 17 18 {% highlight json %} 19 { 20 "bind": { 21 "directory": "myzones" 22 } 23 } 24 {% endhighlight %} 25 26 The BIND accepts some optional metadata via your DNS config when you create the provider: 27 28 In this example we set the default SOA settings and NS records. 29 30 {% highlight javascript %} 31 var BIND = NewDnsProvider('bind', 'BIND', { 32 'default_soa': { 33 'master': 'ns1.example.tld.', 34 'mbox': 'sysadmin.example.tld.', 35 'refresh': 3600, 36 'retry': 600, 37 'expire': 604800, 38 'minttl': 1440, 39 }, 40 'default_ns': [ 41 'ns1.example.tld.', 42 'ns2.example.tld.', 43 'ns3.example.tld.', 44 'ns4.example.tld.' 45 ] 46 }) 47 {% endhighlight %} 48 49 # FYI: get-zones 50 51 When used with "get-zones", specifying "all" scans the directory for 52 any files named `*.zone` and assumes they are zone files. 53 54 ``` 55 dnscontrol get-zones --format=nameonly - BIND all 56 ``` 57 58 # FYI: SOA Records 59 60 DNSControl assumes that SOA records are managed by the provider. Most 61 providers simply generate the SOA record for you and do not permit you 62 to control it at all. The BIND provider is unique in that it must emulate 63 what most DNS-as-a-service providers do. 64 65 When DNSControl reads a BIND zonefile: 66 67 * If there was no SOA record, one is created using the `default_soa` 68 settings listed above. 69 * When generating a new zonefile, the SOA serial number is 70 updated. 71 72 DNSControl ties to maintain the serial number as yyyymmddvv. If the 73 existing serial number is significantly higher it will simply 74 increment the value by 1. 75 76 If you need to edit the SOA fields, the best way is to edit the 77 zonefile directly, then run `dnscontrol preview` and `dnscontrol push` 78 as normal.