The name server must be authoritative for the given zone and must allow updates. This can be done with a section that looks like the following in /etc/bind/named.conf:
zone "dhis.net" {
type master;
file "/etc/bind/db.net.dhis";
allow-update { 127.0.0.1; };
};
You also need to set a basic db.net.dhis file containing the SOA and NS records for the zone before you can use dynamic updates. This may look like this:
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns0
@ IN NS ns1
ns0 IN A 195.185.255.42
ns1 IN A 195.185.255.42
The only supported database at the moment is postgresql. Other databases will be supported in the future but this is not a priority.
Tables for ddtd must be created with the ddt.sql file provided with the server distribution. The owner user, the database name et the access password must be specified in the server config file (typically /etc/ddtd.conf).
Here is the ddt.sql:
drop table userAccounts;
create table userAccounts (
userAccountId int8 UNIQUE,
adminPassword char(32),
updatePassword char(32),
contactName varchar(64),
contactEmail varchar(64),
arch varchar(16),
os varchar(16),
hostStatus int,
lastAccess abstime,
fqdn varchar(64) UNIQUE,
ipAddress varchar(16),
PRIMARY KEY (userAccountId)
);
drop table dnsRecords;
drop sequence dnsrecords_dnsrecordid_seq;
create table dnsRecords (
dnsRecordId serial,
userAccountId int8,
dname varchar(64),
type int,
data varchar(128),
PRIMARY KEY (dnsRecordId,userAccountId)
);
The ddtd.conf file should look like this:
--dbname dhisdb --dbuser remi --dbpass AbCdE --serverport 1052 --clientport 1052
You might want to install some crontabs for doing database backups and vacuums. Vacuums reorder the database and it greatly improves performances to do them regularly, the frequency depending on the number of accesses that are performed. The crontabs may look something like this:
Table 3-1. Sample crontabs
# vacuum the database 4 times a day |
#!/bin/sh |
#!/bin/sh |