System environment:
System: CentOS 6.8mysql:5.1bind:bind-9.11.0-p2.tar.gz Software: ftp://ftp.isc.org/
First, install and configure MySQL.
1. Compile the environment-dependent package installation.
Yum install openssl-devel openldap-devel unixodbc-devel gcc
2. Install MySQL Database
Yum-y install MySQL mysql-server mysql-devel
3. Verify that the installation is successful
[Email protected] ~]# Rpm-qi mysql-server
4. Start the MySQL service
[[email protected] ~]#/etc/init.d/mysqld start
5. Log in and set the password
[email protected] ~]# mysql-u rootmysql> show Databases;mysql> Use mysqlmysql C4>set Password=password ('123456'where user='root ';
6. Open Telnet permission
' Root '@'%'123456'0 rows affected ( 0.00 sec) MySQL>0 rows affected (0.00 sec)
7. Set boot boot (not required)
[[Email protected] ~] #chkconfig mysqld on
Second, download and install Bind-dlz
1. Download and unzip the BIND-DLZ package
[[email protected] opt] #wget ftp://ftp.isc.org/isc/bind9/9.11.0-p2/bind-9.11.0-p2.tar.gz[[Email Protected] opt] #tar-zxvf bind-9.11. 0-p2.tar.gz
2. Compiling on a 64-bit system, you may need to set some variables in order to find the appropriate MySQL library:
[Email protected] ~]# export cppflags="-i/usr/lib64/mysql $CPPFLAGS"~]# Export ldflags="-l/usr/lib64/mysql $LDFLAGS"~]# export ld_library_path=" /usr/lib64/mysql "
3. Compile and install BIND-DLZ.
[Email protected] opt]# CD bind-9.11. 0-p2[[email protected] bind-9.11. 0-p2]#./configure--prefix=/usr/local/bind --enable---enable-largefile--disable--- disable-openssl-version---with-dlz-mysql=yes[[email protected] bind-9.11. 0-p2]# make[[email protected] bind-9.11. 0-p2]# make install
4. Review the version and test that the software is installed successfully
[Email protected] bind-9.11. 0-p2]#/usr/local/bind/sbin/named-9.11. 0-p2 <id:9713922>
5. Configuring rndc.conf and Named.conf files
Generate rndc.conf:
[Email protected] ~]# cd/usr/local/bind/etc/[[email protected] etc]# RNDC-confgen-r/dev/urandom > rndc.co Nf
Provide the CA file
[[email protected] etc] #wget-o named.ca http://www.internic.net/domain/named.root
Create and build named.conf
[Email protected] etc]# tail-rndc.conf | head-9//g > named.conf
Production of named.conf file only key and Controls section, need to manually add the logging and Options section, the complete file as follows:
[email protected] etc]# cat named.conf key"Rndc-key"{algorithm HMAC-MD5; Secret"x0k0uz62actu11ixrna48a==";}; Controls {inet127.0.0.1Port953Allow {127.0.0.1; } keys {"Rndc-key"; };}; Logging {Channel Bind_log {file"/tmp/bind.log"Versions3size 20m; Severity info; Print-Time Yes; Print-severity Yes; Print-category Yes; }; Categorydefault{bind_log; }; };options {Listen-on Port -{192.168.153.130; }; Directory"/usr/local/bind"; Pid-file"Named.pid"; allow-query-cache {any;}; allow-query {any;};};
6. Create a named user so that the bind service runs as a named user,
-s/bin/nologin-d/usr/local/named-~]#chown-R named:named/usr/local/bind/
7. The front desk starts the named service to see if the configuration is normal.
[Email protected] ~]#/usr/local/bind/sbin/named-c/usr/local/bind/etc/named.conf-f-g-u named
Bind-dlz with MySQL