1To use the Dynamic DB sample driver, run named and check the log.
2
3    $ cd testing
4    $ named -gc named.conf
5
6You should be able to see something like:
7
8zone test/IN: loaded serial 0
9zone arpa/IN: loaded serial 0
10
11This means that the sample driver created empty zones "test." and
12"arpa." as defined by "arg" parameters in named.conf.
13
14$ dig @localhost test.
15
16should work as usual and you should be able to see the dummy zone with
17NS record pointing to the zone apex and A record with 127.0.0.1:
18
19;; ANSWER SECTION:
20test.			86400	IN	A	127.0.0.1
21test.			86400	IN	NS	test.
22test.			86400	IN	SOA	test. test. 0 28800 7200 604800 86400
23
24This driver creates two empty zones and allows query/transfer/update to
25all IP addresses for demonstration purposes.
26
27The driver wraps the RBT database implementation used natively by BIND,
28and modifies the addrdataset() and substractrdataset() functions to do
29additional work during dynamic updates.
30
31A dynamic update modifies the target zone as usual. After that, the
32driver detects whether the modified RR was of type A or AAAA, and if so,
33attempts to appropriately generate or delete a matching PTR record in
34one of the two zones managed by the driver.
35
36E.g.:
37
38$ nsupdate
39> update add a.test. 300 IN A 192.0.2.1
40> send
41
42will add the A record
43a.test.			300	IN	A	192.0.2.1
44
45and also automatically generate the PTR record
461.2.0.192.in-addr.arpa.	300	IN	PTR	a.test.
47
48AXFR and RR deletion via dynamic updates should work as usual. Deletion
49of a type A or AAAA record should delete the corresponding PTR record
50too.
51
52The zone is stored only in memory, and all changes will be lost on
53reload/reconfig.
54
55Hints for code readers:
56- Driver initialization starts in driver.c: dyndb_init() function.
57- New database implementation is registered by calling dns_db_register()
58  and passing a function pointer to it. This sample uses the function
59  create_db() to initialize the database.
60- Zones are created later in instance.c: load_sample_instance_zones().
61- Database entry points are in structure db.c: dns_dbmethods_t
62  sampledb_methods
63- sampledb_methods points to an implementation of the database interface.
64  See the db.c: addrdataset() implementation and look at how the RBT
65  database instance is wrapped into an additional layer of logic.
66