亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1913 | 回復(fù): 0
打印 上一主題 下一主題

BIND9 + MySQL (MySQL BIND SDB Driver) [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2011-12-22 08:53 |只看該作者 |倒序?yàn)g覽

BIND 與 MySQL結(jié)合,在BIND9里面已經(jīng)集成了與數(shù)據(jù)庫連接的模塊dlz,但是dlz與mysql結(jié)合有一個(gè)很致命的缺點(diǎn)就是只能將bind編譯

成單線程,這就大大降低了bind的性能,所以選擇了其他模塊MySQL BIND SDB Driver

 

http://mysql-bind.sourceforge.net/

 

在Project Page里面下載 mysql-bind.tar.gz (包里面的README文件其實(shí)有講如何編譯)

 

cp mysqldb.c and mysqldb.h to bind9/bin/named and bind9/bin/named/include/named

 

vim bind9/bin/named/Makefile.in

 

DBDRIVER_OBJS = mysqldb.@O@
DBDRIVER_SRCS = mysqldb.c

DBDRIVER_INCLUDES = -I'/usr/include/mysql'

DBDRIVER_LIBS = -L'/usr/lib/mysql' -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv

 

#如果是x64的機(jī)器,需要修改/usr/lib64

 

In bind9/bin/named/main.c

add an include to mysqldb.h (e.g. #include "mysqldb.h") Then you must register the driver in setup(), by adding mysqldb_init(); before the call to ns_server_create().

 

Unregistration should be in cleanup(), by adding the call mysqldb_clear(); after the call to ns_server_destroy().

 

查找 xxdb_init();
在 注釋文件 xxdb_init();
下添加 mysqldb_init();
然后查找查找 xxdb_clear();
再下面添加mysqldb_clear();
修改完后wq 保存退出,然后開始編譯安裝

./configure --enable-threads --prefix=/opt/bind9

cd /opt/bind9
/opt/bind9/sbin/rndc-confgen > /opt/bind9/etc/rndc.conf
將生產(chǎn)的
key "rndc-key" {
algorithm hmac-md5;
secret "?????????????????";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
copy到named.conf文件
例如
options {
 
        directory "/var/cache/bind";
 
        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113
 
        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders. 
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.
 
        // forwarders {
        //      0.0.0.0;
        // };
 
        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
 
        allow-recursion { any; };
        allow-query { any; };
        recursion yes;
};
 
key "rndc-key" {
        algorithm hmac-md5;
        secret "9OTliFcI9vkDlNuDws5IVA==";
};
 
controls {
        inet 127.0.0.1 port 953
        allow { 127.0.0.1; } keys { "rndc-key"; };
};

編輯named.conf

zone "mydomain.com" {
  type master;
  notify no;
  database "mysqldb dbname tablename hostname user password";
};

 

CREATE TABLE mydomain (
  name varchar(255) default NULL,
  ttl int(11) default NULL,
  rdtype varchar(255) default NULL,
  rdata varchar(255) default NULL
) TYPE=MyISAM;

 

INSERT INTO mydomain VALUES ('mydomain.com', 259200, 'SOA', 'mydomain.com. www.mydomain.com. 200309181 28800 7200 86400 28800');
INSERT INTO mydomain VALUES ('mydomain.com', 259200, 'NS', 'ns0.mydomain.com.');
INSERT INTO mydomain VALUES ('mydomain.com', 259200, 'NS', 'ns1.mydomain.com.');
INSERT INTO mydomain VALUES ('mydomain.com', 259200, 'MX', '10 mail.mydomain.com.');
INSERT INTO mydomain VALUES ('w0.mydomain.com', 259200, 'A', '192.168.1.1');
INSERT INTO mydomain VALUES ('w1.mydomain.com', 259200, 'A', '192.168.1.2');
INSERT INTO mydomain VALUES ('mydomain.com', 259200, 'Cname', 'w0.mydomain.com.');
INSERT INTO mydomain VALUES ('mail.mydomain.com', 259200, 'Cname', 'w0.mydomain.com.');
INSERT INTO mydomain VALUES ('ns0.mydomain.com', 259200, 'Cname', 'w0.mydomain.com.');
INSERT INTO mydomain VALUES ('ns1.mydomain.com', 259200, 'Cname', 'w1.mydomain.com.');
INSERT INTO mydomain VALUES ('www.mydomain.com', 259200, 'Cname', 'w0.mydomain.com.');
INSERT INTO mydomain VALUES ('ftp.mydomain.com', 259200, 'Cname', 'w0.mydomain.com.');

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP