PowerDNS On Ubuntu 14.04 InstallOS : Ubuntu 14.04.2 LTS X86_64
Kernel : 3.13.0-53-generic
½Ã½ºÅÛ ¾÷µ¥ÀÌÆ®
# apt-get update && apt-get upgrade -y
Mysql ¼³Ä¡
# apt-get install mysql-server mysql-client
:: ÁÖ¼®Ã³¸®
# vim /etc/mysql/my.cnf
#bind-address = 127.0.0.1 |
# service mysql restart
PowerDNS ¼³Ä¡
# apt-get install pdns-server pdns-backend-mysql
[MYSQL] PowerDNS µ¥ÀÌŸ ¹× »ç¿ëÀÚ »ý¼º
# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database powerdns;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON powerdns.* TO 'poweruser '@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
¡Ø powerdns - µ¥ÀÌŸº£À̽º
poweruser - µ¥ÀÌŸº£À̽º »ç¿ëÀÚ
password - poweruser Æнº¿öµå
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> use powerdns;
Database changed
:: domains Å×ÀÌºí »ý¼º
mysql> 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)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE UNIQUE INDEX name_index ON domains(name);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
:: records Å×ÀÌºí »ý¼º
mysql> 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)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE INDEX rec_name_index ON records(name);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> CREATE INDEX nametype_index ON records(name,type);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> CREATE INDEX domain_id ON records(domain_id);
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0
:: supermasters Å×ÀÌºí »ý¼º
mysql> CREATE TABLE supermasters (
-> ip VARCHAR(25) NOT NULL,
-> nameserver VARCHAR(255) NOT NULL,
-> account VARCHAR(40) DEFAULT NULL
-> );
Query OK, 0 rows affected (0.01 sec)
PowerDNS ±¸¼º
Zone ÆÄÀÏ°ú ·¹ÄÚµå ±¸¼ºÀ» ¹é¾Øµå·Î MYSQL À» »ç¿ë
# ls /etc/powerdns/pdns.d/
pdns.local.conf pdns.local.gmysql.conf pdns.simplebind.conf
# vim /etc/powerdns/pdns.d/pdns.local.gmysql.conf
# Launch gmysql backend launch=gmysql
# gmysql parameters gmysql-host=localhost gmysql-dbname=powerdns gmysql-user=poweruser gmysql-password=password |
# service pdns restart
¼³Á¤Å×½ºÆ® (³×ÀÓ¼¹ö¸¦ ÀÚ½ÅÀ¸·Î ¼ÂÆÃ)
# vim /etc/resolv.conf
# vim /etc/network/interface
# netstat -tap |grep pdns
tcp 0 0 *:domain *:* LISTEN 4883/pdns_server-in
# dig @localhost
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> @localhost
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37327
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 2800
;; QUESTION SECTION:
;. IN NS
;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jun 08 14:49:19 KST 2015
;; MSG SIZE rcvd: 29