• powerdns的安装


    安装参考连接:https://blog.csdn.net/Empty_city_dreams/article/details/87912970
    安装好以后powerdns配置详解:https://blog.ityuan.com/1305
    彩色版pdns:  https://wiki2.xbits.net:4430/linux:dns:pdns:pdns%E6%89%8B%E5%86%8C
    ############################################################
    
    1.1启用eple仓库,mysql服务器,启用mysql,并设置开机启动
    yum install -y wget
    wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    rpm -ivh mysql-community-release-el7-5.noarch.rpm
    wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    rpm -ivh epel-release-latest-7.noarch.rpm
    yum -y install mariadb-server mariadb
    yum -y search pdns-backend-mysql
    yum install pdns-backend-mysql.x86_64 -y
    systemctl start mariadb  (systemctl start mysql)
    systemctl enable mariadb  (systemctl enable mysqld)
    
    
    
    1.2安装powerdns
    yum -y install pdns pdns-backend-mysql
    
    
    
    
    1.3、为powerdns服务配置一个mariadb数据库
    CREATE DATABASE powerdns;
    GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'abc666666';
    GRANT ALL ON powerdns.* TO 'powerdns'@'centos7.localdomain' IDENTIFIED BY 'abc666666';
    FLUSH PRIVILEGES;
    
    
    #####################################################
    1.4创建powerdns要使用的数据库表
    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,
      content               VARCHAR(64000) DEFAULT NULL,
      ttl                   INT DEFAULT NULL,
      prio                  INT DEFAULT NULL,
      change_date           INT DEFAULT NULL,
      disabled              TINYINT(1) DEFAULT 0,
      ordername             VARCHAR(255) BINARY DEFAULT NULL,
      auth                  TINYINT(1) DEFAULT 1,
      PRIMARY KEY (id)
      ) Engine=InnoDB;
    
    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
      );
    
    CREATE TABLE comments (
      id                    INT AUTO_INCREMENT,
      domain_id             INT NOT NULL,
      name                  VARCHAR(255) NOT NULL,
      type                  VARCHAR(10) NOT NULL,
      modified_at           INT NOT NULL,
      account               VARCHAR(40) NOT NULL,
      comment               VARCHAR(64000) NOT NULL,
      PRIMARY KEY (id)
      ) Engine=InnoDB;
    
    
    CREATE INDEX comments_domain_id_idx ON comments (domain_id);
    CREATE INDEX comments_name_type_idx ON comments (name, type);
    CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
    
    CREATE TABLE domainmetadata (
      id                    INT AUTO_INCREMENT,
      domain_id             INT NOT NULL,
      kind                  VARCHAR(32),
      content               TEXT,
      PRIMARY KEY (id)
      ) Engine=InnoDB;
    
    CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);
    
    CREATE TABLE cryptokeys (
      id                    INT AUTO_INCREMENT,
      domain_id             INT NOT NULL,
      flags                 INT NOT NULL,
      active                BOOL,
      content               TEXT,
      PRIMARY KEY(id)
      ) Engine=InnoDB;
    
    CREATE INDEX domainidindex ON cryptokeys(domain_id);
    
    CREATE TABLE tsigkeys (
      id                    INT AUTO_INCREMENT,
      name                  VARCHAR(255),
      algorithm             VARCHAR(50),
      secret                VARCHAR(255),
      PRIMARY KEY (id)
      ) Engine=InnoDB;
    
    CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
    
    flush privileges;
    
    
    
    1.5配置powerdns
    vim /etc/pdns/pdns.conf
    # launch        Which backends to launch and order to query them in
    #
    # launch=bind
    
    launch=gmysql
    gmysql-host=localhost
    gmysql-user=powerdns
    gmysql-password=abc666666
    gmysql-dbname=powerdns
    
    
    
    2,安装PowerAdmin来管理PowerDNS
    2.1 安装PHP和Apache
    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
    yum -y install php-pear-DB php-pear-MDB2-Driver-mysql
    systemctl enable httpd.service
    systemctl start httpd.service
    cd /var/www/html/
    wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz
    tar xf poweradmin-2.1.7.tgz
    
    3.启动pdns
    systemctl start pdns
    
    3.1进入web页面开始配置
    http://192.168.136.203/poweradmin-2.1.7/install/
    
    
    
    
    页面配置案例:
    
    Username  : powerdns
    Password  : abc666666
    Database type : MySQL
    Hostname  : localhost
    DB Port  : 3306
    Database  : powerdns
    Poweradmin administrator password : admin 
    
    
    Username: admin
    Password: admin
    Hostmaster : localhost.solomon.com
    Primary nameserver:  ns1.solomon.com
    Secondary nameserver : ns2.solomon.com
    
    
    配置完以后删除install 文件夹
    rm -rf /var/www/html/poweradmin-2.1.7/install/
    
    3.2,登录
    http://192.168.136.203/poweradmin-2.1.7
    用户名:admin
    密码:admin
    
    要点:
    在web页面进入配置项后,
    step3的 poweradmin 和step4的username 和password都设置成admin,防止出错
  • 相关阅读:
    【分享】项目开发容易出现的问题?身为前端/后端你见到过吗?
    标准化API设计的重要性
    【分享】对外API接口安全设计
    【实例】调用数据库自动生成接口代码
    【翻译】API-First是什么概念?有什么商业价值?
    保障接口安全的5种常见方式
    【翻译】使用OpenAPI规范进行安全的API设计
    为什么需要API文档
    利用java的反射,实现工厂创建对象
    Cesium入门8
  • 原文地址:https://www.cnblogs.com/zhuhaofeng/p/13259727.html
Copyright © 2020-2023  润新知