README revision a00f9e2f50675bd43cc6a9fe2669709162a2ccb4
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterTo use the Dynamic DB sample driver, run named and check the log.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterYou should be able to see something like:
bef75d63d74f58abc0f834ed271526672777ba29Automatic Updaterzone test/IN: loaded serial 0
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterzone arpa/IN: loaded serial 0
bef75d63d74f58abc0f834ed271526672777ba29Automatic UpdaterThis means that the sample driver created empty zones "test." and
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater"arpa." as defined by "arg" parameters in named.conf.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater$ dig @localhost test.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatershould work as usual and you should be able to see the dummy zone with
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterNS record pointing to the zone apex and A record with 127.0.0.1:
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater;; ANSWER SECTION:
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatertest. 86400 IN A 127.0.0.1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttest. 86400 IN NS test.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttest. 86400 IN SOA test. test. 0 28800 7200 604800 86400
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterThis driver creates two empty zones and allows query/transfer/update to
10b865e9187fc77cae02f106ddcc9e03eecdfe06Tinderbox Userall IP addresses for demonstration purposes.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterThe driver wraps the RBT database implementation used natively by BIND,
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterand modifies the addrdataset() and substractrdataset() functions to do
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updateradditional work during dynamic updates.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterA dynamic update modifies the target zone as usual. After that, the
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterdriver detects whether the modified RR was of type A or AAAA, and if so,
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterattempts to appropriately generate or delete a matching PTR record in
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterone of the two zones managed by the driver.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater> update add a.test. 300 IN A 192.0.2.1
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterwill add the A record
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunta.test. 300 IN A 192.0.2.1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntand also automatically generate the PTR record
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterAXFR and RR deletion via dynamic updates should work as usual. Deletion
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntof a type A or AAAA record should delete the corresponding PTR record
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntThe zone is stored only in memory, and all changes will be lost on
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntHints for code readers:
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- Driver initialization starts in driver.c: dyndb_init() function.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- New database implementation is registered by calling dns_db_register()
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater and passing a function pointer to it. This sample uses the function
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt create_db() to initialize the database.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- Zones are created later in instance.c: load_sample_instance_zones().
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- Database entry points are in structure db.c: dns_dbmethods_t
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt sampledb_methods
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt- sampledb_methods points to an implementation of the database interface.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt See the db.c: addrdataset() implementation and look at how the RBT
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt database instance is wrapped into an additional layer of logic.