本文主要介绍PowerDNS的主要特性和初始化安装的配置方法,侧重点是对复杂程度相对较高PowerDNS Authoritative Server
进行介绍,同时会夹杂部分PowerDNS-Recursor
的初始化安装和配置。
1、PowerDNS简介
PowerDNS(PDNS)成立于20世纪90年代末,是开源DNS软件、服务和支持的主要供应商,它们提供的权威认证DNS服务器和递归认证DNS服务器都是100%开源的软件,同时也和红帽等开源方案提供商一样提供了付费的技术支持版本。同时官方表示为了避免和软件使用者出现竞争,他们只提供服务支持而不提供DNS托管服务。
Our Authoritative Server, Recursor and dnsdist products are 100% open source. For the service provider market, OX also sells the PowerDNS Platform which builds on our Open Source products to deliver an integrated DNS solution with 24/7 support and includes features as parental control, malware filtering, automated attack mitigation, and long-term query logging & searching.
熟悉DNS工作原理的同学可以大致地将DNS记录的查询分为两种:查询本地缓存和向上递归查询。和其他的如BIND、dnsmasq等将这些功能集成到一起的DNS软件不同,PowerDNS将其一分为二,分为了PowerDNS Authoritative Server
和PowerDNS Recursor
,分别对应这两种主要的需求,而我们常说的pdns
指的就是PowerDNS Authoritative Server (后面简称PDNS Auth)
,主要用途就是作为权威域名服务器,当然也可以作为普通的DNS服务器提供DNS查询功能。
对于PowerDNS-Recursor,PowerDNS官网介绍其是一个内置脚本能力的高性能的DNS递归查询服务器,并且已经为一亿五千万个互联网连接提供支持。
The PowerDNS Recursor is a high-performance DNS recursor with built-in scripting capabilities. It is known to power the resolving needs of over 150 million internet connections.
PowerDNS-Recursor(以下简称pdns-rec)的官方文档可以点击这里查看。官方指的内置脚本能力是指在4.0.0版本之后的配置文件里面添加了对lua脚本的支持。
2、PowerDNS安装
2.1 PowerDNS Authoritative Server安装
这里我们还是使用经典的CentOS7系统进行安装测试,系统的相关版本和内核信息如下:
[root@tiny-test home]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.9.2009 (Core)
Release: 7.9.2009
Codename: Core
[root@tiny-test home]# uname -r
3.10.0-1160.11.1.el7.x86_64
pdns对主流的操作系统都有着较好的支持,在centos上面可以直接通过repo仓库来安装,红帽系的Linux可以通过epel源,monshouwer提供的第三方源和powerdns官方源三种源来进行安装。
On RedHat based systems there are 3 options to install PowerDNS, from EPEL, the repository from Kees Monshouwer or from the PowerDNS repositories:
使用epel源来进行安装的话可能会导致无法安装最新版本
如果网络条件允许的话,最好的办法是直接通过官方的repo源来进行安装,如果使用的是master源,则可以安装到最新的测试版本:
yum install epel-release yum-plugin-priorities
curl -o /etc/yum.repos.d/powerdns-auth-master.repo https://repo.powerdns.com/repo-files/centos-auth-master.repo
yum install pdns
yum install pdns-backend-$backend
这里我们使用最新的稳定版4.4版本进行安装,backend
这里我们选择pdns-backend-mysql
yum install epel-release yum-plugin-priorities
curl -o /etc/yum.repos.d/powerdns-auth-44.repo https://repo.powerdns.com/repo-files/centos-auth-44.repo
yum install pdns
yum install pdns-backend-$backend
请注意对于某些软件包源,bind backend作为基本pdns软件包的一部分提供,并且没有单独的pdns-backend-bind软件包。
2.2 PowerDNS-Recursor安装
这里我们还是使用经典的CentOS7系统进行安装测试,系统的相关版本和内核信息如下:
[root@tiny-cloud /home]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.9.2009 (Core)
Release: 7.9.2009
Codename: Core
[root@tiny-cloud /home]# uname -r
3.10.0-1160.24.1.el7.x86_64
pdns对主流的操作系统都有着较好的支持,在红帽系和CentOS系相关的发行版本上面可以之间通过epel源来进行安装