Install powerDNS and poweradmin on Centos

Source: Internet
Author: User
Tags domain list nameserver nslookup command

Install powerDNS and poweradmin on Centos

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,
TypeVARCHAR (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 (
IpVARCHAR (25) not null,
Nameserver VARCHAR (255) not null,
Account VARCHAR (40) DEFAULT NULL
);

Finally, exit mysqlShell:

> 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

# Tarxvfz 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.