http://www.linuxnetworks.de/doc/index.php/PowerDNS...

#cd /usr/local/pgsql/lib/
#cp -r * /usr/lib/
#yum install ncurses-devel
cd /ソース置き場
wget http://linuxnetworks.de/opendbx/download/opendbx-1...
tar xvfz opendbx-1.4.5.tar.gz
cd opendbx-1.4.5
LDFLAGS="-L/usr/local/pgsql/lib" CPPFLAGS="-I/usr/local/pgsql/include" ./configure --prefix=/usr --enable-singlelib --with-backends="pgsql"
make
# make install

#yum install boost-devel
cd /ソース置き場
wget http://downloads.powerdns.com/releases/pdns-2.9.22...
tar xvfz pdns-2.9.22.tar.gz
cd pdns-2.9.22
./configure --with-dynmodules="" --with-modules="opendbx"
make
#make install
cp pdns/pdns /etc/rc.d/init.d/
cp /usr/local/lib/libopendbx* /usr/lib/

vi /usr/local/etc/pdns.conf
#------------------------------------------
launch=opendbx
opendbx-backend=pgsql
opendbx-password=password_for_user_powerdns
#------------------------------------------

powerdnsアカウントでpowerdnsデータベースを作成
http://www.linuxnetworks.de/pdnsodbx/download/tabl... に従って作るが、最後の3コマンドが間違ってるので注意

正しくは以下
CREATE RULE "pdns_rule_records_insert" AS ON insert TO "records" DO UPDATE "domains" SET "auto_serial" = "auto_serial" + 1 WHERE "id" = NEW."domain_id";

CREATE RULE "pdns_rule_records_update" AS ON UPDATE TO "records" DO UPDATE "domains" SET "auto_serial" = "auto_serial" + 1 WHERE "id" = NEW."domain_id";

CREATE RULE "pdns_rule_records_delete" AS ON delete TO "records" DO UPDATE "domains" SET "auto_serial" = "auto_serial" + 1 WHERE "id" = OLD."domain_id";


データベースに投入するデータ まずはドメインから
INSERT INTO domains (name, type) VALUES ('test.com', 'MASTER');
最初のデータならdomain_idは1になるはず、なので以下domain_idを仮に1とする

次にrecordsにSOA
INSERT INTO records ( domain_id, name, type, ttl, prio, content) VALUES ( 1, 'test.com', 'SOA', 300, NULL, 'ns.test.com postmaster@test.com 0 300 900 86400 300');
#↑メルアドの後ろの0がキモ。これでSOAシリアルがオートインクリメントになる

で、NS。 普通は2個以上あるはず
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'test.com', 'NS', 300, NULL, 'ns1.test.com');
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'test.com', 'NS', 300, NULL, 'ns2.test.com');

次はNSのAレコード。NSが当該ドメイン外なら特に必要なし
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'ns1.test.com', 'A', 300, NULL, '111.222.33.44');
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'ns2.test.com', 'A', 300, NULL, '111.222.33.45');

次にMX
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'test.com', 'MX', 300, 20, 'mail.test.com');

MXのAレコード
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'mail.test.com', 'A', 300, NULL, '11.22.33.44');

あとはwwwサーバとか、適当に
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 1, 'www.test.com', 'A', 300, NULL, '11.22.33.40');

●逆引き
INSERT INTO domains (name, type) VALUES ('100.168.192.in-addr.arpa', 'MASTER'); #6だった

INSERT INTO records ( domain_id, name, type, ttl, prio, content) VALUES ( 6, '100.168.192.in-addr.arpa', 'SOA', 300, NULL, 'ns.test.com postmaster@test.com 0 300 900 86400 300');
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 6, '100.168.192.in-addr.arpa', 'NS', 300, NULL, 'ns.test.com');
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 6, '1.100.168.192.in-addr.arpa', 'PTR', 300, NULL, 'myserver192.local');
INSERT INTO records (domain_id, name, type, ttl, prio, content) VALUES ( 6, '10.100.168.192.in-addr.arpa', 'PTR', 300, NULL, 'myserver192.10.local');

※正引き逆引きともに小文字で設定しないと微妙のようです

●spfレコード
http://doc.powerdns.com/types.html
対応。TXTレコードにも対応してるのでdomainkeysも問題なし

●dnssec
DNSSEC record is fully supported, as described in RFC 3757.
Note that while PowerDNS can store, retrieve and serve DNSSEC records, no further DNSSEC processing is performed.
一応dnssecレコードは保持、返答できるが、dnssecレコードの作成などは手動。
http://yebo-blog.blogspot.com/search?q=DNSSEC%E3%8...
をざっと流し読みするに、このままでは手作業が多くて大変。bindでさえ同じ(毎月署名し直す必要あり、過渡期に細心の注意が必要、など)。
対応サイトの少なさからも簡単には普及しないかと。>dnssec
全部自動化してくれるようになるまで難しいんじゃないかなー

todo: dnssec

このページへのコメント

N3xiaY Muchos Gracias for your blog post.Really looking forward to read more. Great.

0
Posted by tips about seo 2013年12月19日(木) 23:38:58 返信

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

Menu

ここは自由に編集できるエリアです。

管理人/副管理人のみ編集できます