2.5. bind其他配置方式

Date:

2018-09

2.5.1. bind压力测试

bind源码包,然后编译安装生成压力测试工具 queryperf

编译生成压力测试工具:

 1[root@dns_02 etc]# mkdir /data/tools -p
 2[root@dns_02 etc]# cd /data/tools/
 3[root@dns_02 tools]# wget http://ftp.isc.org/isc/bind9/9.8.2/bind-9.8.2.tar.gz
 4
 5[root@dns_02 tools]# tar zxf bind-9.8.2.tar.gz
 6[root@dns_02 tools]# cd bind-9.8.2
 7[root@dns_02 tools]# cd bind-9.8.2/contrib/queryperf/
 8[root@dns_02 queryperf]# ./configure
 9
10[root@dns_02 queryperf]# make && make install

创建压力测试文件,压力测试:

 1[root@dns_02 queryperf]# echo 'www.display.tk A'>>test.txt
 2[root@dns_02 queryperf]# for((i=1; i<=100; i++)); do echo 'www.display.tk A'>>test.txt; done;
 3
 4[root@dns_02 queryperf]# ./queryperf -d test.txt 192.168.161.137
 5
 6DNS Query Performance Testing Tool
 7Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $
 8
 9[Status] Processing input data
10[Status] Sending queries (beginning with 127.0.0.1)
11[Status] Testing complete
12
13Statistics:
14
15Parse input file:     once
16Ended due to:         reaching end of file
17
18Queries sent:         101 queries
19Queries completed:    101 queries
20Queries lost:         0 queries
21Queries delayed(?):   0 queries
22
23RTT max:              0.000793 sec
24RTT min:              0.000004 sec
25RTT average:          0.000274 sec
26RTT std deviation:    0.000202 sec
27RTT out of range:     0 queries
28
29Percentage completed: 100.00%
30Percentage lost:        0.00%
31
32Started at:           Sun Oct 28 03:36:55 2018
33Finished at:          Sun Oct 28 03:36:55 2018
34Ran for:              0.003064 seconds
35
36Queries per second:   32963.446475 qps
压力测试注意事项:
  1. 在多个客户端测试bind服务器,防止一个主机的偶然影响。

  2. 测试中调整测试的数量。(例如:100、1000、5000、10000)

  3. 测试中把bind的域名要尽量都测试。(单个域名、混合各个域名)

nslookup测试

 1[root@zzjlogin named]# nslookup      # nslookup测试,这个工具和windows环境的使用是一样的。
 2> server localhost
 3Default server: localhost
 4Address: ::1#53
 5Default server: localhost
 6Address: 127.0.0.1#53
 7> www.display.tk
 8Server:             localhost
 9Address:    ::1#53
10
11Name:       www.display.tk
12Address: 192.168.46.7
13> exit