CentOS 7中安装并配置 PowerDNS

1.安装带有mysql后端的PowerDNS

1.1 启用EPEL仓库,mysql服务器,启用mysql,并设置开机启动

[root@localhost ~]# yum install -y wget
[root@localhost ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
[root@localhost ~]# wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[root@localhost ~]# rpm -ivh epel-release-latest-7.noarch.rpm
[root@localhost ~]# yum install mysql mysql-devel mysql-server -y
[root@test-new ~]# systemctl enable mysql
[root@test-new ~]# service mysqld start

1.2安装PowerDNS

[root@test-new ~]# yum -y install pdns pdns-backend-mysql

1.3为PowerDNS服务配置一个MariaDB数据库

[root@test-new ~]# mysql

mysql>  CREATE DATABASE powerdns;
Query OK, 1 row affected (0.04 sec)

mysql> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'wscl1996.';
Query OK, 0 rows affected (0.30 sec)

mysql> GRANT ALL ON powerdns.* TO 'powerdns'@'centos7.localdomain' IDENTIFIED BY 'wscl1996.';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)

1.4创建PowerDNS要使用的数据库表

创建用于PowerDNS的表domains

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                    BIGINT AUTO_INCREMENT,
  domain_id             INT DEFAULT NULL,
  name                  VARCHAR(255) DEFAULT NULL,
  type                  VARCHAR(10) DEFAULT NULL,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值