Bind-DLZ with MySQL

來源:互聯網
上載者:User

標籤:exp   bind9   lib   dir   directory   int   cal   生產   ase   

系統內容:

系統:centos 6.8Mysql: 5.1BIND: bind-9.11.0-P2.tar.gz軟體:ftp://ftp.isc.org/

一、安裝並配置MySQL.

1.編譯環境相關依賴包安裝.

yum install openssl-devel openldap-devel unixODBC-devel gcc

2.安裝MySQL資料庫

yum -y install mysql mysql-server mysql-devel

3.驗證是否安裝成功

[[email protected] ~]# rpm -qi mysql-server

4.啟動MySql服務

[[email protected] ~]# /etc/init.d/mysqld start

5.登入並設定密碼

[[email protected] ~]# mysql -u rootmysql> show databases;mysql>  use mysql; mysql> update user set password=password(‘123456‘) where user=‘root‘;

6.開放遠程登入許可權

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;Query OK, 0 rows affected (0.00 sec)

7.設定開機啟動(非必須)

[[email protected] ~]#chkconfig mysqld on

二、下載並安裝Bind-DLZ

1.下載並解壓Bind-DLZ軟體包

[[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.在64位系統上編譯,您可能需要設定一些變數,以便找到適當的mysql庫:

[[email protected] ~]# export CPPFLAGS="-I/usr/lib64/mysql $CPPFLAGS"[[email protected] ~]# export LDFLAGS="-L/usr/lib64/mysql $LDFLAGS"[[email protected] ~]# export LD_LIBRARY_PATH="/usr/lib64/mysql"

3.編譯安裝Bind-DLZ.

[[email protected] opt]# cd bind-9.11.0-P2[[email protected] bind-9.11.0-P2]#./configure --prefix=/usr/local/bind  --enable-threads --enable-largefile --disable-ipv6 --disable-openssl-version-check --with-dlz-mysql=yes[[email protected] bind-9.11.0-P2]# make[[email protected] bind-9.11.0-P2]# make install

4.查看版本並測試軟體是否安裝成功

[[email protected] bind-9.11.0-P2]# /usr/local/bind/sbin/named -vBIND 9.11.0-P2 <id:9713922>

5.配置rndc.conf和named.conf檔案

產生rndc.conf:

[[email protected] ~]# cd /usr/local/bind/etc/[[email protected] etc]# rndc-confgen -r /dev/urandom > rndc.conf

提供ca檔案

[[email protected] etc]#wget -O named.ca  http://www.internic.net/domain/named.root

建立並產生named.conf

[[email protected] etc]#  tail -10 rndc.conf | head -9 | sed s/#\ //g > named.conf

生產的named.conf檔案只key和controls部分,需要自己手動添加logging和options部分,完整檔案如下:

[[email protected] etc]# cat named.conf key "rndc-key" {        algorithm hmac-md5;        secret "X0k0Uz62Actu11IXrnA48A==";};controls {        inet 127.0.0.1 port 953        allow { 127.0.0.1; } keys { "rndc-key"; };};logging {        channel bind_log {                file "/tmp/bind.log" versions 3 size 20m;                severity info;                print-time yes;                print-severity yes;                print-category yes;        };        category default {                bind_log;        }; };options {        listen-on port 53 { 192.168.153.130; };        directory "/usr/local/bind";        Pid-file "named.pid";        allow-query-cache { any; };        allow-query     { any; };};

6.建立named使用者,使bind服務以named使用者運行,

[[email protected] ~]#groupadd -r -g 25 named[[email protected] ~]#useradd -r -u 25 -s /bin/nologin -d /usr/local/named -g named named[[email protected] ~]#chown -R named:named /usr/local/bind/

7.前台啟動named服務,看看配置是否正常.

[[email protected] ~]#/usr/local/bind/sbin/named -c /usr/local/bind/etc/named.conf -f -g -u named

 

  

  

  

  

  

  

Bind-DLZ with MySQL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.