2007年01月18日

[root@fjdc bind]# tar -zxvf bind-9.3.3.tar.gz
[root@fjdc bind]# tar -zxvf mysql-bind-0-1.gz
[root@fjdc bind]# cp mysql-bind-0.1/mysqldb.c bind-9.3.3/bin/named/
[root@fjdc bind]# cp mysql-bind-0.1/mysqldb.h bind-9.3.3/bin/named/include/
[root@fjdc bind]# cd bind-9.3.3
[root@fjdc bind-9.3.3]# vi bin/named/Makefile.in
找到:
# Add database drivers here.
#
DBDRIVER_OBJS =
DBDRIVER_SRCS =
DBDRIVER_INCLUDES =
DBDRIVER_LIBS =
改成
DBDRIVER_OBJS = mysqldb.@O@
DBDRIVER_SRCS = mysqldb.c
DBDRIVER_INCLUDES = -I’/usr/local/mysql/include’
DBDRIVER_LIBS = -L’/usr/local/mysql/lib’ -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv

[root@fjdc bind-9.3.3]# vi bin/named/main.c
找到/*
* Add calls to register sdb drivers here.
*/
/* xxdb_init(); */
添加 mysqldb_init();
找到
/*
* Add calls to unregister sdb drivers here.
*/
/* xxdb_clear(); */
添加 mysqldb_clear();

./configure –prefix=/usr/local/named –enable-threads
make
make install
[root@fjdc named]#cd /usr/local/named/etc
[root@fjdc etc]# ../sbin/rndc-confgen >rndc.conf
[root@fjdc etc]# tail -10 rndc.conf | head -9 | sed s/#\//g >named.conf
[root@fjdc etc]# vi localhost.zone
$TTL 86400
$ORIGIN localhost.
        @ 1D IN SOA @ root (
                                42 ; serial (d. adams)
                                3H ; refresh
                                15M ; retry
                                1W ; expiry
                                1D ) ; minimum
1D IN NS @
1D IN A 127.0.0.1

[root@fjdc etc]# vi named.local
$TTL 600
@ IN SOA localhost. root.localhost. (
                                1997022700 ; Serial
                                28800 ; Refresh
                                14400 ; Retry
                                3600000 ; Expire
                                86400 ) ; Minimum
@       IN      NS      localhost.
1       IN      A       127.0.0.1

[root@fjdc etc]# dig > named.root
[root@fjdc etc]# vi named.conf
添加
 zone "." {
        type hint;
        file "named.root";
 };

 zone "localhost" {
        type master;
        file "named.local";
 };

 zone "0.0.127.in-addr.arpa" {
        type master;
        file "named.127.0.0.1";
 };

 zone "mydomain.com" {
        type master;
        database "mysqldb ddns mydomain 127.0.0.1 ddns ddns";
 };

 zone "1.16.172.in-addr.arpa" {
        type master;
        database "mysqldb ddns ptr localhost ddns ddns";
 };

mysql>
建立ddns数据库
建立ddns用户,密码也为ddns;
导入sql到ddns
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’, ‘172.16.1.235′);
INSERT INTO mydomain VALUES (‘w1.mydomain.com’, 259200, ‘A’, ‘172.16.1.100′);
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.’);

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

INSERT INTO `ptr` VALUES (‘1.16.172.in-addr.arpa’, 17600, ‘SOA’, ‘mydomain.com. www.mydomain.com. 200309181 28800 7200 86400 28800′);
INSERT INTO `ptr` VALUES (‘1.16.172.in-addr.arpa’, 17600, ‘NS’, ‘ns0.mydomain.com.’);
INSERT INTO `ptr` VALUES (‘1.16.172.in-addr.arpa’, 17600, ‘NS’, ‘ns1.mydomain.com.’);
INSERT INTO `ptr` VALUES (‘235.1.16.172.in-addr.arpa’, 17600, ‘PTR’, ‘ddns.mydomain.’);

/usr/local/named/sbin/named -c /usr/local/named/etc/named.conf //启动bind
tail -f /var/log/messages | grep named //查看bind日志

2005年10月04日

        不和父亲顶嘴
  
  会哄妈妈开心
  
  不轻易喝醉
  
  不轻易对人说要戒烟,反反复复只会让人觉得言而无信
  
  和她在一起无话可说时,懂得伸手去揽她的肩
  
  失恋的雨夜,自己回家品红酒听肖邦,而不是去站在她楼下淋雨折磨她
  
  不怕孤单
  
  情人节和生日记得给前女友祝贺,仅此而已
  
  女生倒在你怀里哭诉衷肠后,第二天一切正常,不为所动
  
  不轻易发誓,不轻易相信誓言
  
  忘记她的誓言
  
  不轻易愤怒
  
  学会宽恕,分享
  
  不对女生说下流笑话
  
  会送恐龙回家
  
  和美女ONS后,不再纠缠她,拿的起放的下
  
  接受比自己小但有才华的人超过自己
  
  有2年期的人生目标

2005年05月08日

rundll32 netplwiz.dll,UsersRunDll