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、关于PowerDNS
Web管理
PowerDNS的官方,推出了
PowerDNS Platform
,商业版的PowerDNS
平台管理
有兴趣的可以了解一下。