Bonjours à tous.
Après avoir compilé Bind9 avec le support DLZ (Dynamically loadable ZOne), je me suis empressé de testé tout ça.
La communication de Bind et MySQL ce fait sans problème.
Sauf que j’ai des problème au niveau des donnée dans ma tables, voici le log:
On peut retrouver des infirmation sur la fonction dns_sdlz_putrr sur le site officiel http://bind-dlz.sourceforge.net/mysql_driver.html, mais je comprend pas tout
named[11005]: the working directory is not writable (Quel repertoire ?)
named[3002]: dns_sdlz_putrr returned error. Error code was: extra input text
dns_rdata_fromtext: buffer-0x42dff8c0:1: near 'ns1.scandal.fr.': extra input text
Voici mon named.conf
dlz "Mysql zone" {
database "mysql
{host=localhost dbname=dns_data}
{select zone from dns_records where zone = '%zone%'}
{select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"')
else data end from dns_records where zone = '%zone%' and host = '%record%'
and not (type = 'SOA' or type = 'NS')}
{select ttl, type, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
from dns_records where zone = '%zone%' and (type = 'SOA' or type='NS')}
{select ttl, type, host, mx_priority, data, resp_person, serial, refresh, retry, expire,
minimum from dns_records where zone = '%zone%' and not (type = 'SOA' or type = 'NS')}
{select zone from xfr_table where zone = '%zone%' and client = '%client%'}
{update data_count set count = count + 1 where zone ='%zone%'}";
};
La structure de la table pour les domaines
CREATE TABLE IF NOT EXISTS `dns_records` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`zone` varchar(64) DEFAULT NULL,
`host` varchar(64) DEFAULT NULL,
`type` varchar(8) DEFAULT NULL,
`data` varchar(64) DEFAULT NULL,
`ttl` int(11) NOT NULL DEFAULT '3600',
`mx_priority` int(11) DEFAULT NULL,
`refresh` int(11) NOT NULL DEFAULT '3600',
`retry` int(11) NOT NULL DEFAULT '3600',
`expire` int(11) NOT NULL DEFAULT '86400',
`minimum` int(11) NOT NULL DEFAULT '3600',
`serial` bigint(20) NOT NULL DEFAULT '2008082700',
`resp_person` varchar(64) NOT NULL DEFAULT 'resp.person.email',
`primary_ns` varchar(64) NOT NULL DEFAULT 'ns1.yourdns.here',
`data_count` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `host` (`host`),
KEY `zone` (`zone`),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Voici mes champ pour mon domaine, sachant que j’ai autorité sur le domaine et que ça fonctionnais avec les zones dans des fichier texte.
scandal.fr @ soa ns1.scandal.fr. 3600 NULL 28000 3600 64800 3600 2010042800 admin.scandal.fr. ns1.yourdns.here 0
scandal.fr @ ns ns1.scandal.fr. 3600 0 0 0 0 0 0 ns1.yourdns.here 0
scandal.fr @ ns slv2.1and1.fr. 10 0 0 0 0 0 0 ns1.yourdns.here 0
scandal.fr scandal.fr a 91.121.220.145 10 0 0 0 0 0 0 ns1.yourdns.here 0
scandal.fr www a 91.121.220.145 10 0 0 0 0 0 0 ns1.yourdns.here 0
scandal.fr sql a 91.121.220.145 10 0 0 0 0 0 0 ns1.yourdns.here 0