Install powerDNS and poweradmin on Centos

Source: Internet
Author: User
Tags domain list nslookup command
1. install the lamp environment successfully. 2. install powerdns # yum-yinstallpdnspdns-backend-mysql to connect to mysql: # mysql-uroot-p to create a powerdns database: & gt; CREATEDATABASEpowerdns; for Po

1. installation prerequisites

The lamp environment has been installed successfully;

2. 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=gmysqlgmysql-host=127.0.0.1gmysql-user=power_admingmysql-password=power_admin_passwordgmysql-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.

3. install poweradmin

(1) Poweradmin also needs to install two PEAR software packages.

# Yum install php-pear-DB php-pear-MDB2-Driver-mysql

Now the environment required by Poweradmin has been configured. we will install Poweradmin under the/usr/local/apache2/htdocs/directory, which is the root directory of apache documentation.

Download: wget https://cloud.github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz

# Tar xvfz poweradmin-2.1.5.tgz

(2) install it in the/usr/local/apache2/htdocs/poweradmin directory.

# Music poweradmin-2.1.6/usr/local/apache2/htdocs/poweradmin

# Touch/usr/local/apache2/htdocs/poweradmin/inc/config. inc. php

# Chown-R www: www/usr/local/apache2/htdocs/poweradmin

(3)

 

1. open http: // ip/poweradmin/install/index. php in the browser. by default, Click Go to step 2.

2. click "Go to step 3" to Go to step 3 of installation, and fill in the database details. Enter the root user and password, and the admin user password of Poweradmin.

 

3. click next, enter the information of the power_admin mysql User created in the step of installing powerdns, and enter the domain name server address:

 

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.

 

5. click next.

 

6. the installation of poweradmin is complete.

 

7. to ensure security, you need to delete the installation directory.

Rm-rf/usr/local/nginx/html/poweradmin/install

Now you can go to the http: // 192.168.0.100/poweradmin page, enter the user admin and the password set during installation to enter the management interface.

 

Enter the correct user name and password and enter:

 

(4) add A record for testing

 

1. add a primary domain

Click Add primary domain, enter 51cto.com in the domain name, and click add domain. the prompt that the domain is successfully added is displayed.

 

 

 

2. add A record

Click the domain list and view the domain.

 

Enter the desired name in the name, the IP address in the content, and click add record. a success prompt is displayed in English.

 

 

(5) restart the powerdns service

 

[Root @ tengine ~] # Service pdns restart

Restarting PowerDNS authoritativenameserver: stopping and waiting... done

Starting PowerDNS authoritative nameserver: started

(6) query on the client

Set the dns server IP address on the client and run the nslookup command to query the IP address.

 

So far, the entire powerdns setup is complete.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.