パスワードを忘れた? アカウント作成
601736 journal

quanchanの日記: BINDからの移行(その2)

日記 by quanchan

zone2sqlを実行すると、こんなSQLを吐いてくれますので
MySQLに突っ込んでおきます。

$ zone2sql --named-conf=/home/quanchan/named/named.conf \
--gmysql --start-id=1 > quanchan.sql

$ cat quanchan.sql
insert into domains (name,type) values ('quanchan.org','NATIVE');
insert into records (domain_id, name,type,content,ttl,prio)
select id ,'quanchan.org', 'SOA',
'ns.quanchan.org postmaster.quanchan.org 2004091501 10800 3600 604800 38400',
86400, 0 from domains where name='quanchan.org';
insert into records (domain_id, name,type,content,ttl,prio)
select id ,'quanchan.org', 'NS', 'ns.quanchan.org', 86400, 0
  from domains where name='quanchan.org';
insert into records (domain_id, name,type,content,ttl,prio)
select id ,'quanchan.org', 'MX', 'mail.quanchan.org', 86400, 10
from domains where name='quanchan.org';

601738 journal

quanchanの日記: BINDからの移行(その1)

日記 by quanchan

zone2sqlコマンドで、BINDの設定をSQLに変換してくれます。
named.confファイルはBIND8相当の指定しか受け付けないらしい
ので、BIND9風に書いている人は修正してください。

% cat /home/quanchan/named/named.conf
options {
                  directory "/home/quanchan/named";
                  auth-nxdomain yes;
                  allow-query {any;};
};

zone "quanchan.org" {
                type master;
                file "quanchan.org";
                allow-transfer {trusted;};
};

% cat /home/quanchan/named/quanchan.org
$TTL 86400
@ IN 86400 SOA ns.quanchan.org. postmaster.quanchan.org. (
    2004091501
                10800
                3600
                604800
                38400 )
;
                IN NS ns.quanchan.org.
;
                IN MX 10 mail.quanchan.org.

601741 journal

quanchanの日記: SQL流し込み

日記 by quanchan

一ヶ月近く間があいちゃいましたね。

とりあえず、MySQLに以下のSQLを流し込んでおきます。

------------------------------------------
CREATE TABLE domains (
  id INT auto_increment,
  name VARCHAR(255) NOT NULL,
  master VARCHAR(20) 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)
)type=InnoDB;

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)
)type=InnoDB;

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
);
GRANT SELECT ON supermasters TO pdns;
GRANT ALL ON domains TO pdns;
GRANT ALL ON records TO pdns;
------------------------------------------

360957 journal

quanchanの日記: pdns.confを設定しておく

日記 by quanchan
/usr/local/etc/pdns.confを設定しておきませう。

---------------------------------------
# cat /usr/local/etc/pdns.conf
launch=gmysql
gmysql-host=<mysql-server>
gmysql-dbname=pdns
gmysql-user=pdns
gmysql-password=<pdns-password>
setgid=pdns
setuid=pdns
---------------------------------------
<mysql-server>にMySQLが起動しているIPアドレス。
DBサーバにはデータベースpdns,ユーザpdns,
パスワードを<pdns-password>で設定しておきます。
360950 journal

quanchanの日記: PowerDNSをインストールだけしておく

日記 by quanchan
MySQLはあらかじめ入れておいてください。
とりあえずPowerDNSインストールぢゃ。

# wget http://downloads.powerdns.com/releases/pdns-2.9.16.tar.gz
# tar zxvf pdns-2.9.16.tar.gz
# cd pdns-2.9.16
# ./configure --with-modules="gmysql"
# make
# make install

pdnsのユーザでデーモン動かしておきますか。
# useradd pdns
360947 journal

quanchanの日記: PowerDNSことはじめ 2

日記 by quanchan
最近やっとこさPowerDNSを使い始めたので、ボチボチ書いていくことにします。
日本語の文献が全然無いのですが、なんででしょうねぇ?
とりあえずURL書いておきます。
PowerDNSのサイト
typodupeerror

吾輩はリファレンスである。名前はまだ無い -- perlの中の人

読み込み中...