Note: This article was written alongside BIND 10 1.0.0-beta. See this article which covers the major differences to be aware of between 1.0.0-beta, and 1.0.0-rc.
The third article in my series detailing the newest DNS software release from ISC - BIND 10 - will cover the configuration of zone transfers and dynamic DNS, both secured with TSIG. This article assumes you know a little about the new architecture of BIND 10 (I’ve written about it here).
I have two servers configured for this as follows, both running BIND 10 built as per my first article in the series:
|
1 2 |
172.16.18.169 ns1.example.com dolan 172.16.18.172 ns2.example.com gooby |
No BIND 10 modules other than the default have been enabled at this point, and the servers have been started for the very first time. First, we need to perform some configuration of our master DNS server - ns1.example.com.
Master Configuration
I’ll work through the required master DNS server configuration in stages, explaining the steps as you follow along.
Connect to your master instance using bindctl. First, enable the required modules for an authoritative DNS service (b10-auth), also supporting outbound zone transfers (b10-xfrout):
|
1 2 3 4 5 6 7 |
> config add /Boss/components b10-auth > config set /Boss/components/b10-auth/kind needed > config set /Boss/components/b10-auth/special auth > config add /Boss/components b10-xfrout > config set /Boss/components/b10-xfrout/address Xfrout > config set /Boss/components/b10-xfrout/kind dispensable > config commit |
See my previous article if this makes no sense at all. The configuration is committed, and a check of the logs will show the appropriate modules being started. You can also use Boss show_processes from the bindctl prompt.
Next, add your TSIG key (I generated mine with dnssec-keygen available with the bindutils package on many modern Linux distributions, or with the BIND 9 source):
|
1 2 |
> config add tsig_keys/keys "example.com.key:xxxxxxxxxxxxxxxxxxxxxxxx" > config commit |
The next piece of configuration is of the Xfrout module itself (which we refer to by its message bus address, not component name):
|
1 2 3 4 |
> config add Xfrout/zone_config > config set Xfrout/zone_config[0]/origin "example.com" > config set Xfrout/zone_config[0]/transfer_acl [{"action": "ACCEPT", "key": "example.com.key", "from": "172.16.18.172"}] > config commit |
OK - a lot just happened there. I configured a new zone configuration (index 0, it’s the first one) with origin "example.com" and a transfer_acl that ACCEPTs only zone transfer requests from 172.16.18.172 (our slave’s IP) and encrypted using the TSIG key example.com.key. I could also have set up IXFR here, but with the current BIND 10 release there is no failback to AXFR should IXFR fail. So, AXFR will suffice.
Xfrout is now configured to allow zone transfers. We still need a way of updating the zone (without manually altering the backend) and allowing NOTIFYs to work. DDNS is the way to go here. When the b10-ddns module receives an update (from nsupdate, for example), it sends a NOTIFY to b10-xfrout, which in turn sends out NOTIFYs to all NS records (other than itself) present in the database backend for the updated zone.
To handle this, enable the b10-ddns module as well as the zone manager - b10-zonemgr:
|
1 2 3 4 5 6 7 |
> config add /Boss/components b10-zonemgr > config set /Boss/components/b10-zonemgr/address Zonemgr > config set /Boss/components/b10-zonemgr/kind dispensable > config add /Boss/components b10-ddns > config set /Boss/components/b10-ddns/address DDNS > config set /Boss/components/b10-ddns/kind dispensable > config commit |
Run Boss show_processes and make sure the modules are enabled and the processes are running. Finally, configure DDNS so that it is aware of example.com, and will only accept updates from clients using TSIG key example.com.key.
|
1 2 3 4 |
> config add DDNS/zones > config set DDNS/zones[0]/origin "example.com" > config add DDNS/zones[0]/update_acl {"action": "ACCEPT", "key": "example.com.key"} > config commit |
Slave Configuration
A number of configuration steps must now be performed on the slave server, ns2.example.com. Start by enabling the appropriate modules required for authoritative DNS service, inbound zone transfers and zone management (b10-auth, b10-xfrin and b10-zonemgr respectively):
|
1 2 3 4 5 6 7 8 9 10 |
> config add /Boss/components b10-auth > config set /Boss/components/b10-auth/kind needed > config set /Boss/components/b10-auth/special auth > config add /Boss/components b10-xfrin > config set /Boss/components/b10-xfrin/address Xfrin > config set /Boss/components/b10-xfrin/kind dispensable > config add /Boss/components b10-zonemgr > config set /Boss/components/b10-zonemgr/address Zonemgr > config set /Boss/components/b10-zonemgr/kind dispensable > config commit |
Confirm all is well with Boss show_processes. Add your TSIG key, ensuring it is identical to the master key (otherwise zone transfers will obviously fail):
|
1 2 |
> config add tsig_keys/keys "example.com.key:xxxxxxxxxxxxxxxxxxxxxxxx" > config commit |
Next, configure Xfrin and Zonemgr as follows:
|
1 2 3 4 5 6 7 |
> config add Xfrin/zones > config set Xfrin/zones[0]/name "example.com" > config set Xfrin/zones[0]/master_addr "172.16.18.169" > config set Xfrin/zones[0]/tsig_key "example.com.key" > config add Zonemgr/secondary_zones > config set Zonemgr/secondary_zones[0]/name "example.com" > config commit |
Now that you’re getting to grips with the BIND 10 way of doing things, you should see what we’re doing above - configuring Xfrin to get example.com (name) from 172.16.18.169 (master_addr) using the example.com.key (tsig_key) TSIG key. Note, we also have to add a secondary_zones definition so that Zonemgr can handle the management of the slave zones.
Loading a Zone, Dynamic Updates and More
If you’ve got this far, load an example zone in to the master instance:
|
1 2 3 4 |
# ./b10-loadzone example.com /var/tmp/db.example.com 2013-02-14 22:42:06.403 INFO [b10-loadzone.loadzone/61933] LOADZONE_SQLITE3_USING_DEFAULT_CONFIG Using default configuration with SQLite3 DB file /usr/local/bind10-1.0.0-beta/var/bind10/zone.sqlite3 2013-02-14 22:42:06.416 INFO [b10-loadzone.loadzone/61933] LOADZONE_ZONE_CREATED Zone example.com./IN does not exist in the data source, newly created 2013-02-14 22:42:06.420 INFO [b10-loadzone.loadzone/61933] LOADZONE_DONE Loaded (at least) 0 RRs into zone example.com./IN in 0.00 seconds |
The zone should be instantly provisioned on the master, and a NOTIFY sent to the slave, who duly performs an AXFR of the zone. Run dig against both nameservers to ensure they both have the same copy of the zone loaded:
|
1 2 3 4 |
# dig SOA example.com @ns1.example.com +short ns1.example.com. hostmaster.example.com. 2013140205 172800 900 1209600 3600 # dig SOA example.com @ns2.example.com +short ns1.example.com. hostmaster.example.com. 2013140205 172800 900 1209600 3600 |
The master BIND logs will show messages such as:
|
1 2 |
2013-02-14 22:42:10.561 INFO [b10-xfrout.xfrout/61804] XFROUT_XFR_TRANSFER_STARTED AXFR client 172.16.18.172:38121: transfer of zone example.com/IN has started 2013-02-14 22:42:10.563 INFO [b10-xfrout.xfrout/61804] XFROUT_XFR_TRANSFER_DONE AXFR client 172.16.18.172:38121: transfer of example.com/IN complete |
And the slave should show:
|
1 2 3 |
2013-02-14 22:42:10.500 INFO [b10-xfrin.xfrin/61260] XFRIN_ZONE_NO_SOA Zone example.com/IN does not have SOA 2013-02-14 22:42:10.505 INFO [b10-xfrin.xfrin/61260] XFRIN_XFR_TRANSFER_STARTED AXFR transfer of zone example.com/IN started 2013-02-14 22:42:10.525 INFO [b10-xfrin.xfrin/61260] XFRIN_TRANSFER_SUCCESS full AXFR transfer of zone example.com/IN succeeded (messages: 1, records: 9, bytes: 338, run time: 0.025 seconds, 13650 bytes/second) |
The slave complains about the SOA record not existing - which is fine as this is a new zone and will not be present in the slave’s database at first.
Connect via nsupdate, and add a new resource record to the zone:
|
1 2 3 4 5 6 |
# nsupdate > server ns1.example.com > key example.com.key xxxxxxxxxxxxxxxxxxxxxxxx > update add foo.example.com 86400 A 172.16.18.100 > send > quit |
If you receive a NOTAUTH(BADKEY) response, check you are using the correct TSIG key for your zone update.
If all went well, in the master BIND logs you should see something like:
|
1 2 3 4 |
2013-02-14 23:02:00.414 INFO [b10-xfrout.notify_out/62128] NOTIFY_OUT_SENDING_NOTIFY sending notify to 172.16.18.172#53 2013-02-14 23:02:00.424 INFO [b10-xfrout.xfrout/62128] XFROUT_XFR_TRANSFER_STARTED AXFR client 172.16.18.172:38125: transfer of zone example.com/IN has started 2013-02-14 23:02:00.427 INFO [b10-xfrout.notify_out/62128] NOTIFY_OUT_SENDING_NOTIFY sending notify to 172.16.18.172#53 2013-02-14 23:02:00.429 INFO [b10-xfrout.xfrout/62128] XFROUT_XFR_TRANSFER_DONE AXFR client 172.16.18.172:38125: transfer of example.com/IN complete |
And on the slave:
|
1 2 |
2013-02-14 23:02:00.369 INFO [b10-xfrin.xfrin/61260] XFRIN_XFR_TRANSFER_STARTED AXFR transfer of zone example.com/IN started 2013-02-14 23:02:00.394 INFO [b10-xfrin.xfrin/61260] XFRIN_TRANSFER_SUCCESS full AXFR transfer of zone example.com/IN succeeded (messages: 1, records: 14, bytes: 442, run time: 0.030 seconds, 14607 bytes/second) |
Awesome stuff. Zone transfers, TSIG and DDNS are all working as expected under BIND 10.
If you need to manually send notifies for a zone, you can do so using bindctl from the master as follows:
|
1 |
> Xfrout notify example.com |
And if you need to manually retransfer a zone from the master to a slave, log into the slave via bindctl and issue:
|
1 |
> Xfrin retransfer example.com |
A Note About Xfrout
When initially using nsupdate after configuring DDNS, b10-ddns was unable to notify b10-xfrout that an update had been made, and this no notifies were sent to the slaves. The following message was noted in the master BIND logs:
|
1 |
2013-02-14 22:45:18.131 ERROR [b10-ddns.ddns/61874] DDNS_UPDATE_NOTIFY_FAIL failed to notify Xfrout of updates to example.com/IN: Unknown zone: example.com./IN |
I tried shutting down the Xfrout module, to let the Boss restart it:
|
1 2 3 4 |
> Xfrout shutdown { "error": "Module 'Xfrout' not responding" } |
Uh-oh! Out to the shell for a bit of kill -9 … Then the Boss restarted it anyway.
And, not during the course of this article - but worth noting here anyway, on another system Xfrout failed to send notifies for a newly added zone, complaining:
|
1 2 3 4 |
> Xfrout notify example.com { "error": "Unknown zone: example.com./IN" } |
This was fixed with (again):
|
1 |
> Xfrout shutdown |
The Boss process then automatically restarted Xfrout - the desired effect. So - the Xfrout module does seem to be a little buggy and has needed a couple of restarts to make it work as configured.
Conclusion
This article has guided you through the configuration of outbound and inbound zone transfers, TSIG and Dynamic DNS with BIND 10.
Whilst the configuration is manageable, I’ve yet to load additional zones and evaluate the administrative complexity of the configuration. With even a few hundred zones configured for transfer, I can imagine using bindctl to be quite cumbersome. However, more interfaces are promised, and even bindctl could be wrapped and scripted with a slightly friendlier interface if you felt like it.