README revision aefb3e308ba01ad47a3d3aaadf77a5edd4261cb9
ac4e70ff8955669341f435bc0a734a17c01af124Mark AndrewsBIND 9 DLZ MySQL module with support for dynamic DNS (DDNS)
205c10066a0acfeac52d1a135671f41d207b8557Automatic Updater
205c10066a0acfeac52d1a135671f41d207b8557Automatic UpdaterAdapted from code contributed by Marty Lee, Maui Systems Ltd.
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic UpdaterThis is a dynamically loadable zone (DLZ) plugin that uses a fixed-
2bb3422dc683c013db7042f5736240de6b86f182Automatic Updaterschema MySQL database for back-end storage. It allows zone data
cd0aa2d941d1438fabb5337f1f38c49478edf71dAutomatic Updaterto be updated via dynamic DNS updates, and sends DNS NOTIFY packets
2ec4ab21838e218863d052ebfa3e106e04f50820Evan Huntto other name servers when appropriate.
ea854b585041ad19f70f7af15e08144ef2c2bd1bMark Andrews
78cb74fab4665da2e2641ba909c6f59f74cc4193Automatic UpdaterThe database for this module uses the following schema:
cd0aa2d941d1438fabb5337f1f38c49478edf71dAutomatic Updater
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater CREATE TABLE `Zones` (
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington `id` int(11) NOT NULL AUTO_INCREMENT,
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews `domain` varchar(128) NOT NULL DEFAULT '',
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater `host` varchar(128) NOT NULL DEFAULT '',
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington `admin` varchar(128) NOT NULL DEFAULT '',
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater `serial` int(11) NOT NULL DEFAULT '1',
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater `expire` int(11) NOT NULL DEFAULT '86400',
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater `refresh` int(11) NOT NULL DEFAULT '86400',
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews `retry` int(11) NOT NULL DEFAULT '86400',
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater `minimum` int(11) NOT NULL DEFAULT '86400',
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater `ttl` int(11) NOT NULL DEFAULT '86400',
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews `writeable` tinyint(1) NOT NULL DEFAULT '0',
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews PRIMARY KEY (`id`),
96713299d08c0735c18ebe8772dd2cc1ecd4356aAutomatic Updater KEY `domain_idx` (`domain`)
831f79c4310a7d38fc3475ccfff531b2b2535641Automatic Updater );
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater CREATE TABLE `ZoneData` (
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews `id` int(11) NOT NULL AUTO_INCREMENT,
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater `zone_id` int(11) NOT NULL,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson `name` varchar(128) NOT NULL DEFAULT '',
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater `type` varchar(16) NOT NULL DEFAULT '',
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater `ttl` int(11) NOT NULL DEFAULT '86400',
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson `data` varchar(128) NOT NULL DEFAULT '',
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater PRIMARY KEY (`id`),
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater KEY `zone_idx` (`zone_id`),
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater KEY `name_idx` (`zone_id`, `name`),
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt KEY `type_idx` (`type`)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater );
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt'Zones' contains information about specific zones:
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - domain: the zone name
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - admin: the zone administrator
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - serial, expire, reresh, retry, minimum: values in the SOA record
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt - ttl: default zone TTL
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater - writeable: set to true if the zone can be updated via DDNS
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt'ZoneData' contains the individual records within the zone:
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - zone_id: the 'id' from the corresponding record in Zones
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - name: domain name, relative to the zone apex. (Data at the zone
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater apex itself may use a blank name or "@".)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - type: the RR type, expressed as text
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater - ttl: the record's TTL
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater - data: the records rdata, expressed as text.
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic UpdaterTo configure this module in named.conf:
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterdlz "mysqldlz" {
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater database "dlopen <path to>/dlz_mysqldyn_mod.so <dbname> [dbhost [dbuser [dbpass]]]";
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews};
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews