This release adds the querying of a live database to JDNSS.
There are four new command line options to connect to a database.
JDNSS now uses the same schema as powerdns:
http://doc.powerdns.com/generic-mypgsql-backends.html
Note: there are no PQDNs allowed -- all names are assumed to be fully
qualified and are not terminated by dots.
Here's an example that I use for test:
---------------------------------------------------------------------------
CREATE DATABASE JDNSS;
USE JDNSS;
CREATE USER 'JDNSS'@'localhost' IDENTIFIED BY 'JDNSS';
create table domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);
CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
create table supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);
GRANT SELECT ON supermasters TO JDNSS;
GRANT ALL ON domains TO JDNSS;
GRANT ALL ON records TO JDNSS;
INSERT INTO domains (name, type) values ('computingfrontiers.org', 'NATIVE');
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'computingfrontiers.org', 'SOA', 'ns1.computingfrontiers.org beaty.emess.mscd.edu 23 28800 7200 604800 86400', 3600, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'computingfrontiers.org', 'NS', 'ns1.computingfrontiers.org', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'computingfrontiers.org', 'NS', 'ns2.computingfrontiers.org', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'computingfrontiers.org', 'MX', 'mail.computingfrontiers.org', 86400, 10);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'computingfrontiers.org', 'A', '147.153.165.102', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'www.computingfrontiers.org', 'A', '147.153.165.102', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'mail.computingfrontiers.org', 'A', '147.153.165.102', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'ns1.computingfrontiers.org', 'A', '147.153.165.98', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'ns2.computingfrontiers.org', 'A', '147.153.165.102', 86400, 0);
insert into records (domain_id, name,type,content,ttl,prio)
values (1, 'www.computingfrontiers.org', 'AAAA', 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210', 86400, 0);
values (1, 'computingfrontiers.org', 'TXT', 'this is a test', 86400, 0);
values (1, 'ftp.computingfrontiers.org', 'CNAME', 'www.computingfrontiers.org', 86400, 0);
---------------------------------------------------------------------------