powerdns的安装与配置

PowerDNS 是一个跨平台的开源DNS服务组件,PowerDNS同时有Win32和Linux/Unix的版本。 PowerDNS在Win32下使用 Access的mdb文件记录DNS信息,而在Linux/Unix下则使用MySQL来记录DNS信息。无论是mdb亦或MySQL,备份是非常方便的 事情

安装步骤:

1、安装mysql

yum -y install mysql mysql-server

2、开机启动

chkconfig --levels 235 mysqld on /etc/init.d/mysqld start  

3、修改mysql root密码:

mysqladmin -u root password  

4、安装pdns

yum -y install pdns pdns-backend-mysql  

5、创建powerdns数据库:

CREATE DATABASE powerdns;

6、 为PowerDNS创建powerdns数据库用户:

GRANT ALL ON powerdns.* TO 'power_admin'@'localhost' IDENTIFIED BY '************'; FLUSH PRIVILEGES;

7、现在创建数据表:

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

8、  现在配置PowerDNS以使用mysql后端

vi /etc/pdns/pdns.conf ######添加#######   launch=gmysql gmysql-host=127.0.0.1 gmysql-user=power_admin gmysql-password=************ gmysql-dbname=powerdns  

9、安装Poweradmin的所需要的包

yum -y install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext  

10、设置apache自启动,并启动apache。

  chkconfig --levels 235 httpd on /etc/init.d/httpd start

11、Poweradmin还需要安装两个PEAR软件包。

  yum install php-pear-DB php-pear-MDB2-Driver-mysql  

12、下载powerdnsadmin   poweradmin-2.1.6.tgz

https://www.poweradmin.org/trac/wiki/News/Poweradmin2.1.6Released  

13、安装在/var/www/html/poweradmin目录。

  tar xvfz poweradmin-2.1.5.tgz mv poweradmin-2.1.5 /var/www/html/poweradmin touch /var/www/html/poweradmin/inc/config.inc.php chown -R apache:apache /var/www/html/poweradmin/  

14、开始配置

http://192.168.1.100/poweradmin/install/ 第二步默认继续   不过如果不执行的话会报错误,嘿嘿,可以尝试下。。。   安装完成。 After you have removed the directory, you can login to Poweradmin with username "admin" and password "*****l". You are highly encouraged to change these as soon as you are logged in.   15、为了安全效果,不过也必须删除,否者产生错误Error: The install/ directory exists, you must remove it first before proceeding. rm -fr /var/www/html/poweradmin/install/   删除之后,刷新页面   登录 http://192.168.1.100/poweradmin/index.php   使用文档后期会逐步推出。。 参考 http://www.centos.bz/2011/10/centos-5-install-powerdns-server/    
  • 编辑powerdns 配置文件 /etc/powerdns/pdns.conf ,使其使用mysql 数据库,找到如下字段,修改如下, recursor 表示如果查询的域名不在本机上,则向上级域名服务器查询,查询的地址为8.8.8.8

[...]

# 注释如下行 ################################# # allow-recursion       List of netmasks that are allowed to recurse allow-recursion #allow-recursion ################################# # launch        Which backends to launch and order to query them in # # launch= launch=gmysql [...] ################################# # recursor      If recursion is desired, IP address of a recursing nameserver # recursor=8.8.8.8

创建普通用户,创建A记录是否可用

1、http://192.168.1.100/poweradmin/ 登录

2、添加用户

 

3、尝试登录

4、添加A记录

5、查看是否已经解析了

使用体验

前提条件,将DNS调整为192.168.1.100

Windows条件下:
 
Linux条件下:
修改/etc/resolv.conf  文件,改DNS为192.168.1.100  

添加zone记录

说明添加成功  

添加A记录

http://192.168.1.100/poweradmin/index.php?logout 登录powerdns 说明已经添加上了        

转载于:https://my.oschina.net/766/blog/211402

PowerDNS Recursor是一个递归DNS服务器,可以用于解析域名。以下是PowerDNS Recursor的配置文件详解。 1. 配置文件路径 PowerDNS Recursor的配置文件路径为/etc/powerdns/recursor.conf。 2. 基本配置 以下是一些基本配置: ``` # 设置PowerDNS Recursor的监听地址和端口 local-address=127.0.0.1 local-port=53 # 设置PowerDNS Recursor的缓存大小 cache-size=1000 # 设置查询超时时间 query-timeout=5000 # 设置PowerDNS Recursor的日志级别 loglevel=4 ``` 3. 高级配置 以下是一些高级配置: ``` # 设置PowerDNS Recursor的递归深度 recursion-depth=10 # 设置PowerDNS Recursor的最大TCP连接数 max-tcp-connections=10 # 设置PowerDNS Recursor的最大UDP包大小 edns-packet-max=4096 # 设置PowerDNS Recursor的缓存时间 min-cache-ttl=60 max-cache-ttl=86400 neg-cache-ttl=60 # 设置PowerDNS Recursor的DNSSEC验证 dnssec=process-no-validate # 设置PowerDNS Recursor的线程数 threads=1 ``` 4. DNSSEC配置 以下是一些DNSSEC配置: ``` # 启用DNSSEC验证 dnssec=process # 设置DNSSEC的根证书 dnssec-root-key-file=/etc/powerdns/root.key # 设置DNSSEC的DS记录 dnssec-ds-add=example.com 256 3 8 ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB # 设置DNSSEC的验证日志 dnssec-log-level=4 ``` 5. 日志配置 以下是一些日志配置: ``` # 记录PowerDNS Recursor的查询日志 query-logging=yes query-log-file=/var/log/powerdns/query.log log-dns-details=yes # 记录PowerDNS Recursor的统计信息 statistics-file=/var/log/powerdns/stats.log statistics-interval=60 ``` 以上是PowerDNS Recursor的配置文件详解。根据需要,可以根据实际需求自定义配置。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值