Recently intends to bind the record information into the database, the Internet to find the next, the original had written a mysql-bind patch, recompile bind can be implemented bind support MySQL storage. (
http://mysql-bind.sourceforge.net/
According to the official practice is not feasible, there is a small place to be amended, the following will be mentioned.
Environmental centos5.2
Yum Install mysql*
Finish the MySQL installation.
Download the Mysql-bind patch and Google will find it.
Download bind source code, the official website has under
https://www.isc.org/
After extracting the above two softwares, start the installation configuration.
CP MYSQL-BIND/MYSQLDB.C bind9-9.5.1.dfsg.p2/bin/named/
CP Mysql-bind/mysqldb.h bind9-9.5.1.dfsg.p2/bin/named/include/
Note: BIND9-9.5.1.DFSG.P2 is the version number of BIND, bind9.4 and above are supported.
Mysql_config–cflags
Results:-i/usr/include/mysql-g-pipe-wp,-d_fortify_source=2-fexceptions-fstack-protector--param=ssp-buffer-size=4- M32-march=i386-mtune=generic-fasynchronous-unwind-tables-d_gnu_source-d_file_offset_bits=64-d_largefile_source -fno-strict-aliasing-fwrapv
Mysql_config–libs
Results:-l/usr/lib/mysql-lmysqlclient-lz-lcrypt-lnsl-lm-l/usr/lib-lssl-lcrypto
# VI Bind9-9.5.1.dfsg.p2/bin/named/makefile.in
Line 29:DBDRIVER_OBJS =
[[email protected]] [Email protected] [/email]
@
Line 30:dbdriver_srcs = MYSQLDB.C
Line 31:dbdriver_includes =-i/usr/include/mysql
Line 32:dbdriver_libs =-l/usr/lib/mysql-lmysqlclient-lz-lcrypt-lnsl-lm-l/usr/lib-lssl-lcrypto
# VI BIND9-9.5.1.DFSG.P2/BIN/NAMED/MAIN.C
Line: #include "mysqldb.h"
Line 729:mysqldb_init (); (Hint: xxdb_init () below)
Line 756:mysqldb_clear (); (Hint: xxdb_clear () below)
The above steps can be fully referred to the official website of the operation procedures.
The following step is critical, and without modification, it will cause compilation to fail. (It took three days to fix the problem)
Change line the MYSQLDB.C from #include to #include "include/mysqldb.h" (seen on a friend's blog in Singapore, the copyright period is reproduced in the E-text, not translated
)
Work completed before this configuration
./configure--prefix=/usr/local/named--enable-threads--disable-openssl-version-check
Make&&make install completed successfully.
Save the bind record to MySQL has two advantages, one eliminates the trouble configuration of the master-slave update, direct the primary DNS and MySQL from the DNS master-slave replication can be, two point is to modify the record does not need to reload, and easy to write PHP management interface.
This article comes from Chinaunix blog, if you look at the original point:Http://blog.chinaunix.net/u2/70648/showart_1998507.html
Bind supports MySQL