首页 > DNS服务器 > 正文

How To Install PowerDNS on CentOS 6.3 x64
2015-12-24 22:37:31   来源:   评论:0 点击:

How To Install PowerDNS on CentOS 6 3 x64

Step 1 - Install REMI and EPEL Repositories and Packages

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install php php-mcrypt php-pdo php-mysql pdns pdns-backend-mysql mysql-server httpd

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
处理很简单,修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉。即可

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

Step 2 - Create a Database and Username

service mysqld start
service httpd start
mysqladmin create powerdns


Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
ServerName localhost:80

 
 

Forbidden
You don't have permission to access /install/test.html on this server.
________________________________________
Apache/2.2.15 (CentOS) Server at 210.22.12.240 Port 80

使用setenforce 0关闭SELinux
 

Make sure to select your own password below:

mysql -Bse "create user 'powerdns'@'localhost' identified by 'password'"
mysql -Bse "grant all privileges on powerdns.* to 'powerdns'@'localhost'"

Step 3 - Create PowerDNS databases and tables:

Start mysql console with "mysql"

mysql> 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
);

Exit mysql console by typing "exit":

mysql> exit

Step 4 - Install PowerAdmin

Login as root and run:

cd /root 
wget hhttps://github.com/poweradmin/poweradmin/archive/master.zip
tar xvfz poweradmin-2.1.6.tgz
cd poweradmin-2.1.6/inc
mv config-me.inc.php config.inc.php

Edit config.inc.php and make sure to change password you've specified in Step 2:

nano config.inc.php

Modify db_pass and session_key to your own values:

$db_host                = 'localhost';
$db_port                = '3306';
$db_user                = 'powerdns';
$db_pass                = 'password';
$db_name                = 'powerdns';
$db_type                = 'mysql';
$session_key            = 'session_key';

Move PowerAdmin folder to Apache's DocumentRoot. We can use this droplet's IP address to manage our DNS settings

mv /root/poweradmin-2.1.6/* /var/www/html/
service httpd restart

Edit /etc/pdns/pdns.conf and add the following lines, make sure to modify gmysql-password to MySQL password you've selected in Step 2:

launch=gmysql
gmysql-host=localhost
gmysql-user=powerdns
gmysql-password=password
gmysql-dbname=powerdns

Restart Power DNS daemon:

service pdns restart

Step 5 - Create PowerAdmin Account

Proceed to installing PowerAdmin from webserver. Navigate over to your droplet's IP /install folder (in our case http://198.211.110.153/install/ ).

Create a Poweradmin admin account:

Next step is optional:

Finish the installation process, and after you get to Step 7, remove /var/www/html/install folder:

rm -rf /var/www/html/install

Now you can navigate to your droplet's IP ( http://198.211.110.153/ in our case), and login as admin with password you've specified in Step 5.

Now you can create your own DNS zone records:

You can verify that your new PowerDNS server is working by running dig against it:

dig @198.211.110.153 domain.com

;; ANSWER SECTION:
domain.com.             86400   IN      A       127.0.0.1

相关热词搜索:How To Install PowerDNS

上一篇:DNS服务器工作原理
下一篇:最后一页

分享到: 收藏