This is an old revision of the document!
http://www.misdivision.com/blog/create-your-own-dynamic-dns-service-using-powerdns-and-mysql
http://gnudip2.sourceforge.net
Here we provide a dynamic DNS service using PowerDNS and MySQL.
Here we install the packages and set the MySQL root password. Adjust as necessary:
yum install pdns pdns-backend-mysql mysql-server vim-enhanced chkconfig mysqld on chkconfig pdns on service mysqld start mysqladmin -u root password 'new-password' mysqladmin -u root -h <your-server-fqdn> password 'new-password'
Now we log in to MySQL:
mysql -u root -p
Now, at the MySQL prompt, we configure MySQL permissions. Adjust as necessary:
CREATE DATABASE powerdns; GRANT ALL ON powerdns.* TO 'power_admin'@'localhost' IDENTIFIED BY 'power_admin_password'; GRANT ALL ON powerdns.* TO 'power_admin'@'<your-server-fqdn>' IDENTIFIED BY 'power_admin_password'; FLUSH PRIVILEGES;
Now we create the database:
USE powerdns; 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 ); quit;
vim /etc/pdns/pdns.conf
Add the following lines to 'Launch' section of pdns.conf:
################################# # launch Which backends to launch and order to query them in # # launch= launch=gmysql gmysql-host=127.0.0.1 gmysql-user=power_admin gmysql-password=power_admin_password gmysql-dbname=powerdns
Start PowerDNS:
service pdns start
https://www.poweradmin.org/trac/wiki/GettingPoweradmin
yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext php-pear-DB php-pear-MDB2-Driver-mysql
Start web server:
chkconfig httpd on /etc/init.d/httpd start
Get the latest PowerAdmin and install it:
wget https://github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz tar xvfz poweradmin-2.1.6.tgz mv poweradmin-2.1.6 /var/www/html/poweradmin touch /var/www/html/poweradmin/inc/config.inc.php chown -R apache:apache /var/www/html/poweradmin/