관리자 글쓰기
[DNS] powerdns 설치
2017. 1. 17. 13:23 - 미나리다

@Powerdns


웹상으로 관리할수있어  설치는 번거롭지만 한번 설치하고나면 설정하는게 편하다

다만 db를 직접써서 넣어주어야되기때문에 어렵다


# yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# yum install pdns pdns-backend-mysql pdns-recursor


# mysql -u root -p


 > create database powerdns;


 > create user powerdns@'%' identified by 'password' ;


 > grant all privileges on *.* to powerdns@localhost identified by 'password'


 > 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

);


# vim /etc/pdns/pdns.conf

setuid=pdns

setgid=pdns

config-dir=/etc/pdns

daemon=yes

guardian=yes

local-port=53

module-dir=/usr/lib64/pdns

recursor=127.0.0.1:54

allow-recursion=127.0.0.1,자신의서버IP

socket-dir=/var/run

version-string=PDNS

launch=gmysql

//주석해제



 gmysql-host=localhost

 gmysql-user=powerdns

 gmysql-password=dns

 gmysql-dbname=powerdns

 gmysql-port=3306

 gmysql-socket=/tmp/mysql.sock

//직접써줌




# vim /etc/pdns-recursor/recursor.conf 

setuid=pdns-recursor

setgid=pdns-recursor

config-dir=/etc/pdns-recursor/

daemon=yes

disable-axfr=yes

local-port=54

socket-dir=/var/run/

version-string=PDNS

allow-from=0.0.0.0/0

local-address=127.0.0.1

quiet=yes



# service pdns restart



# cd /usr/local/src

# wget https://github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz

# tar -zxvf poweradmin-2.1.6.tgz

# mv poweradmin-2.1.6.tgz /usr/local/apache/htdocs/poweradmin

# cd /usr/local/apache/htdocs/poweradmin

# touch config.ini.php

http://IP/poweradmin/install 에 접속하여 설치진행