PowerDNS introduction PowerDNS is a high-performance domain name server. in addition to supporting common BIND configuration files, PowerDNS can also read data from databases such as MySQL, Oracle, and PostgreSQL. PowerDNS is installed with Poweradmin, which is convenient for managing DNS records on the Web. This document uses MySQL as the backend database and Poweradmin
Introduction to PowerDNS
PowerDNS is a high-performance domain name server. in addition to supporting common BIND configuration files, PowerDNS can also read data from databases such as MySQL, Oracle, and PostgreSQL. PowerDNS is installed with Poweradmin, which is convenient for managing DNS records on the Web. In this article we take MySQL as the back-end database and Poweradmin web page to manage DNS, install PowerDNS in CentOS-5.
Install MySQL
Yum-y installMysql Mysql-Server
Set mysql to start and start mysql
Chkconfig -- levels 235 mysqld on
/Etc/init. d/mysqld start
Modify the mysql root password:
Mysqladmin-u root password yourrootsqlpassword
Install PowerDNS
Yum-y install pdns-backend-mysql
Connect to mysql:
Mysql-u root-p
Create a powerdns database:
Create database powerdns;
Create a PowerDNS database user for powerdns:
Grant all on powerdns. * TO 'Power _ admin' @ 'localhost' IDENTIFIED
BY 'power _ admin_password ';
Flush privileges;
Replace power_admin_password with your own password.
Create a data table now:
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
);
Finally, exit mysql shell:
Quit;
Now configure PowerDNS to use the mysql backend:
Vi/etc/pdns. conf
Add the following content to 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
[...]
Set PowerDNS to start automatically and start PowerDNS immediately.
Chkconfig -- levels 235 pdns on
/Etc/init. d/pdns start
Currently, PowerDNS is running normally. next we will install Poweradmin for PowerDNS to implement Web management.
Install Poweradmin
Poweradmin runs in the PHP environment. now we configure the Web environment.
Yum-y install httpd 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
Set apache to start automatically and start apache.
Chkconfig -- levels 235 httpd on
/Etc/init. d/httpd start
Poweradmin also needs to install two PEAR packages.
Yum install php-pear-DB php-pear-MDB2-Driver-mysql
Now the environment required by Poweradmin has been configured. we will install Poweradmin in the/var/www/html directory, which is the default apache document root directory.
Go to https://www.poweradmin.org/trac/wiki/gettingpoweradminto find the latest download path:
Cd/tmp
Wget
Https://www.poweradmin.org/download/poweradmin-2.1.5.tgz
Then install it in the/var/www/html/poweradmin directory.
Tar xvfz poweradmin-2.1.5.tgz
Music poweradmin-2.1.5/var/www/html/poweradmin
Touch/var/www/html/poweradmin/inc/config. inc. php
Chown-R apache: apache/var/www/html/poweradmin/
Open the browser to run the installer (for example, http: // www.Centos. Bz/poweradmin/install or http: // 192.168.0.100/poweradmin/install ).
1. select English language and click Go to step 2.
Http://img10.3lian.com/d0214/file/2011/10/11/62fa53cb68d69279fbf11ec4fe835145.jpg"
>
2. click "Go to step ".
3 "to the third step of installation, fill in the database details. Enter the root user and password, and the admin user password of Poweradmin.
Http://img10.3lian.com/d0214/file/2011/10/11/ee11de4c5f198170952b99dc1770bd98.jpg"
>
3. click next and fill in the power_admin created in the step of installing powerdns.
Mysql user information, and fill in the domain name server address:
Http://img10.3lian.com/d0214/file/2011/10/11/72ab763b5ca77942df7d81b845930e6d.jpg"
>
4. the next step is to execute the mysql statement. We do not need to execute it because we have already executed it. just click next.
Http://img10.3lian.com/d0214/file/2011/10/11/7fe85622f6acc479b21cfcbb0a21641a.jpg"
>
5. click next.
Http://img10.3lian.com/d0214/file/2011/10/11/a2a6ad666829511451a53c04caeab774.jpg"
>
6. now the installation of poweradmin is complete.
Http://img10.3lian.com/d0214/file/2011/10/11/421b07a5041825d2cc21ed596e5de804.jpg"
>
7. to ensure security, you need to delete the installation directory.
Rm-fr/var/www/html/poweradmin/install/
Now you can go to the ingress.