2. MySQL backend

2.1. Configuration settings
2.2. Notes

[Warning]Warning

This backend is deprecated! Use the Generic MySQL backend which is better in all respects. It does support master/slave operation, this backend does not. See Section 5, “Generic MySQL and PgSQL backends”.

So stop reading here unless you already have a database filled with 'mysql' records.

Table A.2. MySQL backend capabilities

NativeYes
MasterNo
SlaveYes
SuperslaveNo
AutoserialYes
CaseInsensitive
DNSSECNo (but see Generic backend!)
Module namemysql
Launch namemysql


The MySQL Backend as present in PDNS is fixed - it requires a certain database schema to function. This schema corresponds to this create statement:

          CREATE TABLE records (
	  id int(11) NOT NULL auto_increment,
	  domain_id int(11) NOT NULL,
	  name varchar(255) NOT NULL,
	  type varchar(10) NOT NULL,
	  content varchar(255) NOT NULL,
	  ttl int(11) NOT NULL,
	  prio int(11) default NULL,
	  change_date int(11) default NULL,
	  PRIMARY KEY (id),
	  KEY name_index(name),
	  KEY nametype_index(name,type),
	  KEY domainid_index(domain_id)
	  );
        

Every domain should have a unique domain_id, which should remain identical for all records in a domain. Records with a domain_id that differs from that in the domain SOA record will not appear in a zone transfer.

The change_date may optionally be updated to the time_t (the number of seconds since midnight UTC at the start of 1970), and is in that case used to auto calculate the SOA serial number in case that is unspecified.

2.1. Configuration settings

WARNING! Make sure that you can actually resolve the hostname of your database without accessing the database! It is advised to supply an IP address here to prevent chicken/egg problems!

mysql-dbname

Database name to connect to

mysql-host

Database host to connect to

mysql-password

Password to connect with

mysql-socket

MySQL socket to use for connecting

mysql-table

MySQL table name. Defaults to 'records'.

mysql-user

MySQL user to connect as

2.2. Notes

It has been observed that InnoDB tables outperform the default MyISAM tables by a large margin. Furthermore, the default number of backends (3) should be raised to 10 or 15 for busy servers.