编译Bind和压力测试

编译安装bind


·下载bind:

    isc.org:

         bind-9.8

         bind-9.9

         bind-10

·编译安装bind:

         # tar xvf bind-9.11.0a3.tar.gz

         # cd bind-9.11.0a3/

         # groupadd -r -g 53 named

         # useradd -r -u 53 -g 53 named

         # ./configure –prefix=/usr/local/bind9 –sysconfdir=/etc/named/ –disable-ipv6 –disable-chroot –enable-threads

         # make

         # make install

·环境变量:

         vim /etc/profile.d/named.sh

         export PATH=/usr/local/bind9/bin:

         /usr/local/bind9/sbin/:$PATH

·库和头文件:

         vim /etc/ld.so.conf.d/named.conf

         /usr/local/bind9/lib

         ldconfig –v

         ls -sv /usr/local/bind9/include /usr/include/named

·man帮助:

         vim /etc/man.config

         MANPATH /usr/local/bind9/share/man

         man named.conf

·配置文件:

        vim /etc/named/named.conf

                 options {

                     directory "/var/named/"

                 };

                 zone "." IN {

                         type hint;

                         file "named.ca";

                 };

                 zone "localhost" IN {

                         type master;

                         file “named.localhost";

                         allow-update {none;};

                 };

                 zone “1.0.0.127.in-addr.arpa" IN {

                         type master;

                         file "named.loopback";

                         allow-update {none;};

                 };

·区域数据库文件:

         mkdir /var/named

         dig +norec @a.root-servers.net > /var/named/named.ca

         vim /var/named/named.localhost

                 $TTL 1d

                 @ IN SOA localhost. admin.localhost. (

                                 2016061801

                                 1h

                                 5m

                                 7d

                                 1d )

                         IN NS localhost.

                 localhost. IN A 127.0.0.

        

         vim /var/named/named.local

                 $TTL 1d

                 @ IN SOA localhost. admin.localhost. (

                                 2016061801

                                 1h

                                 5m

                                 7d

                                 1d )

                         IN NS localhost.

                         IN PTR localhost.

·设置权限:

         chmod 640 /var/named/*

         chmod 640 /etc/named/named.conf

         chown :named /var/named/*

         chown :named /etc/named/named.conf

·启动服务和测试:

         man named

         named -u named -f -g -d 3 前端级别3方式运行

         named -u named 后台运行

         killall named

         ss -uln

         tail /var/log/message

         named -u named

·支持rndc:

         rndc reload 看报错提示

         rndc-confgen -r /dev/urandom > /etc/named/rndc.conf :生成key

         tail /etc/named/rndc.conf >> /etc/named/named.conf

         killall -SIGHUP named

         rndc status

        

压力测试


/root/bind-xxx/contrib/scripts

·编译压力测试工具

         cd /root/bind-xxx/contrib/queryperf

         ./configure

         make

         cp queryperf /usr/local/bind9/bin

         queryperf -h

·编译测试文本<可以cp文件中的行数,生成10万–100万行的文本,进行压力测试>

         vim test.txt

                 www.gm.com A

                 gm.com NS

                 gm.com MX

                 web.gm.com A

         queryperf -d test.txt -s 127.0.0.1

·打开日志功能:

         rndc querylog

         rndc status

         queryperf -d test.txt -s 127.0.0.1

         wc -l /var/log/message

原创文章,作者:megedugao,如若转载,请注明出处:http://www.178linux.com/49089

评论列表(1条)

  • 马哥教育
    马哥教育 2016-09-26 13:20

    对bind进行压力测试可以结合top命令,看看其对cpu的使用率和内存的使用率进行评估一个DNS服务器的性能,文章好像也没有提到,测试结果是怎么评估的哦,