Ubuntu 18.04 安装部署 Power DNS 4.1

1、修改和加入源

修改ubuntu的源,加上restricted universe multiverse字段

~$ sudo vim /etc/apt/sources.list

deb http://mirrors.yun-idc.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.yun-idc.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.yun-idc.com/ubuntu/ bionic-updates main restricted universe multiverse

加入PowerDNS的源,加入apt-key

~$ sudo vim /etc/apt/sources.list.d/pdns.list

deb [arch=amd64] http://repo.powerdns.com/ubuntu bionic-auth-master main

~$ sudo /etc/apt/preferences.d/pdns

Package: pdns-*
Pin: origin repo.powerdns.com
Pin-Priority: 600

~$ curl https://repo.powerdns.com/CBC8B383-pub.asc | sudo apt-key add -

加入MariaDB源,通过官方网站选择合适的源 (MariaDB源)

~$ sudo vim /etc/apt/sources.list.d/mariadb.list

deb [arch=amd64,arm64,ppc64el] http://mirrors.neusoft.edu.cn/mariadb/repo/10.3/ubuntu bionic main

~$ sudo apt-get install software-properties-common
~$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

2、开始安装配置MariaDB

比较简单 apt install即可,直接安装MariaDB

~$ sudo apt install mariadb-server 

获取mysql表结构文件和外键修改文件,相关文件在github上的源码中,可以直接下载

~$ cd ~
~$ wget -c https://raw.githubusercontent.com/PowerDNS/pdns/rel/auth-4.1.x/modules/gmysqlbackend/schema.mysql.sql
~$ wget -c https://raw.githubusercontent.com/PowerDNS/pdns/rel/auth-4.1.x/modules/gmysqlbackend/enable-foreign-keys.mysql.sql

登录MariaDB执行,创建用户,数据库和表

~$ sudo mysql -u root -p

MariaDB [(none)]> CREATE USER 'pdns'@'localhost' IDENTIFIED BY 'pdns';
MariaDB [(none)]> CREATE DATABASE powerdns;
MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'pdns'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit;

~$ sudo mysql -u pdns -p

MariaDB [(none)]> use powerdns;
MariaDB [powerdns]> source ~/schema.mysql.sql
MariaDB [powerdns]> source ~/enable-foreign-keys.mysql.sql
MariaDB [powerdns]> exit

3、安装配置PowerDNS

加入mysql的配置,在pdns.d文件夹内创建mysql的配置文件gmysql.conf如下:

~$ sudo apt install pdns-server pdns-backend-mysql pdns-backend-lua pdns-tools 
~$ sudo vim /etc/powerdns/pdns.d/gmysql.conf

launch+=gmysql
gmysql-host=localhost
gmysql-port=3306
gmysql-dbname=powerdns
gmysql-user=pdns
gmysql-password=pdns
gmysql-dnssec=no
gmysql-innodb-read-committed=yes
gmysql-timeout=10

4、配置PowerDNS

/etc/powerdns/pdns.conf的'local-address中设置好本机IP`即可

~$ sudo vim /etc/powerdns/pdns.conf

local-address=本机IP

添加系统服务,并启动

~$ sudo systemctl enable pdns
~$ sudo systemctl start pdns
5、关于PowerDNSWeb管理

PowerDNS的官方,推出了PowerDNS Platform,商业版的PowerDNS平台管理
有兴趣的可以了解一下。

你可能感兴趣的:(Ubuntu 18.04 安装部署 Power DNS 4.1)