17
Jan

PowerDNS pdns

   Posted by: admin   in Mẹo vặt của hiếu râu

wget http://downloads.powerdns.com/releases/pdns-3.3.1.tar.gz

tar -zxvf pdns-3.3.1.tar.gz

cd pdns-3.3.1

./configure –with-modules=”gmysql” –without-lua

make && make install

vi /usr/local/etc/pdns.conf

launch=gmysql

#gmysql-host=127.0.0.1

gmysql-socket=/var/run/mysql/mysql.sock

gmysql-user=xxx

gmysql-dbname=pdns

gmysql-password=xxx

——– SQL ———

CREATE TABLE `records` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`domain_id` int(11) DEFAULT NULL,

`name` varchar(255) DEFAULT NULL,

`type` varchar(10) DEFAULT NULL,

`content` varchar(64000) DEFAULT NULL,

`ttl` int(11) DEFAULT NULL,

`prio` int(11) DEFAULT NULL,

`change_date` int(11) DEFAULT NULL,

PRIMARY KEY (`id`),

KEY `nametype_index` (`name`,`type`),

KEY `domain_id` (`domain_id`)

) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1

CREATE TABLE `domains` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`name` varchar(255) NOT NULL,

`master` varchar(128) DEFAULT NULL,

`last_check` int(11) DEFAULT NULL,

`type` varchar(6) NOT NULL,

`notified_serial` int(11) DEFAULT NULL,

`account` varchar(40) DEFAULT NULL,

PRIMARY KEY (`id`),

UNIQUE KEY `name_index` (`name`)

) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1

+—-+————–+——–+————+——–+—————–+———+

| id | name         | master | last_check | type   | notified_serial | account |

+—-+————–+——–+————+——–+—————–+———+

|  1 | macatung.com | NULL   |       NULL | NATIVE |            NULL | NULL    |

+—-+————–+——–+————+——–+—————–+———+

+—-+———–+——————-+——+——————————-+——-+——+————-+

| id | domain_id | name              | type | content                       | ttl   | prio | change_date |

+—-+———–+——————-+——+——————————-+——-+——+————-+

|  1 |         1 | macatung.com      | SOA  | localhost info@macatung.com 1 | 86400 | NULL |        NULL |

|  2 |         1 | macatung.com      | NS   | ns1.macatung.com              | 86400 | NULL |        NULL |

|  3 |         1 | macatung.com      | NS   | ns2.macatung.com              | 86400 | NULL |        NULL |

|  4 |         1 | www.macatung.com  | A    | 127.0.0.1                     |   120 | NULL |        NULL |

|  5 |         1 | mail.macatung.com | A    | 127.0.0.2                     |   120 | NULL |        NULL |

|  6 |         1 | macatung.com      | MX   | mail.macatung.com             |   120 |    5 |        NULL |

+—-+———–+——————-+——+——————————-+——-+——+————-+

pdns_server –daemon=no
pdns_server –daemon=yes
zone2sql –named-conf=/etc/named.conf –gmysql
=========== CENTOS 6 ===============
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install pdns pdns-backend-mysql
This entry was posted on Friday, January 17th, 2014 at 11:20 am and is filed under Mẹo vặt của hiếu râu. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment