CentOS7 环境下搭建主从DNS服务器
一.DNS介绍
1、DNS(domain name server)是域名解析服务器,提供域名和IP地址之间一种相互转换的机制,目的是为了方便人们的记忆和管理
2、DNS总共有13个根域 从a-m
. (根域)
|
——————————————————————————————————
| | | |
顶级域1 .com 顶级域2 .edu 顶级域3 .cn 顶级域n .gov
|
————————
| |
子域1 .home.edu 子域2 .teacher.edu
常用顶级域名:
com 商业组织
edu 教育组织
gov 政治组织
cn 中国
等等
3、DNS求解过程:
客户向本地DNS服务器发布请求,请求[url]www.baidu.com[/url]主机的IP地址。
如果目标主机是本域的,则DNS服务器直接返回客户要求的IP地址。
否则DNS服务器在缓存DNS中分别查找[url]www.baidu.com[/url]、redhat.com
如查没有就向其上级域或直接向根域名服务器发出请求,上级域返回redhat.com的IP、根域名服务器会返回com的IP。
本地域服务器保存此IP后再向com服务器发出请求,得到redhat.com的IP。
本地域名服务器再向redhat.com发求请求,得到[url]www.baidu.com[/url]的IP。
4、区域及授权:
一个域(domain)包含一个完整的分级域名下层树
一个区(zone)则是域的一部分,被一个具体详细的服务器所管理.
子域可以被授权成为附加的域
一个区可以直接管理子域
5、INTERNET上的分级DNS:
根域名服务器
作为区认证域名服务器的最高级别域名服务器存在
为递归查询提供权威解释
区认证域名服务器
区的划分与认证
主域名服务器与从域名服务器
6、主域和从域:
主域服务器
拥有一个域的主复制数据
从域服务器
为主服务器提供自动数据备份
每一个从服务器都会自动从主服务器处同步更新数据
7、DNS服务器分为四类:
主D N S服务器( m a t e r 或 p r i m a r y )
从D N S服务器( s l a v e 或 s e c o n d a r y )
缓存D N S服务器( c a c h i n g )
转发D N S服务器( forwarders )
客户端求截过程:
客户端检索本地数据文件的相关记录
客户端将无法自行解释的需求,通过53端口送给指定的DNS服务器
主从服务器的搭建配置:
CentOS7系统:主DNS(192.168.10.103)从DNS(192.168.10.104)
二、主DNS的配置:
1、关闭防火墙\关闭SeLinux\设置时间同步:
systemctl stop firewalld.service && systemctl disable firewalld.service
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
yum -y install wget net-tools ntp ntpdate lrzsz
systemctl restart ntpdate.service ntpd.service && systemctl enable ntpd.service ntpdate.service
2、配置主机映射/etc/hosts
echo 192.168.10.101 linux-node1.server.com >> /etc/hosts
echo 192.168.10.102 linux-node2.server.com >> /etc/hosts
echo 192.168.10.103 linux-node3.server.com >> /etc/hosts
echo 192.168.10.104 linux-node4.server.com >> /etc/hosts
echo nameserver 192.168.10.103 >> /etc/resolv.conf
echo nameserver 192.168.10.104 >> /etc/resolv.conf
hostnamectl --static set-hostname linux-node3.server.com
bash
3、安装DNS的相关软件我们可以使使用“YUM”来安装:
bind # BIND服务器软件包
bind-chrooot # 为BIND提供 chroot 机制的软件包
bind-utils # DNS测试程序软件包
caching-nameserver # 这个包是提供模板的,在Linux6.版本系统就没有这个包了。
[root@linux-node3 ~]# yum -y install bind*
查看:
[root@linux-node3 var]# systemctl start named
[root@linux-node3 var]# netstat -tunl | grep 53
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
4、创建配置文件 rndc.conf
rndc-confgen > /var/named/chroot/etc/rndc.key //创建不了,是权限问题要给权限
查看rndc.conf
[root@linux-node3 ~]# grep -v "^#" /var/named/chroot/etc/rndc.key | grep -v "^$"
================key "rndc-key"这部分放到主配置文件named.conf或者如下步骤===========
key "rndc-key" {
algorithm hmac-md5;
secret "rH1P5+zLqu2flxZKpTe7Ag==";
};
===================================================================================
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
进到DNS的named.conf主配置文件:
[root@linux-node3 ~]# vi /etc/named.conf
key "rndc-key" {
algorithm hmac-md5;
secret "rH1P5+zLqu2flxZKpTe7Ag==";
};
或者写路径
include "/etc/rndc.key";
[root@linux-node3 ~]# cat /etc/rndc.key
key "rndc-key" {
algorithm hmac-md5;
secret "rH1P5+zLqu2flxZKpTe7Ag==";
};
[root@linux-node3 ~]# rndc reload #加载配置文件
server reload successful
[root@linux-node3 ~]# rndc flush #刷新
5、修改主配置文件和区域配置文件:
[root@linux-node3 ~]# grep -v "^#" /etc/named.conf |grep -v "^$"
options {
listen-on port 53 { any; };#ipv4监听端口是53,any是允许所有ip监听。比如vip
listen-on-v6 port 53 { any; };#IPV6的监听地址(注释//监听到所有的53号端口上)
directory "/var/named";#指定解析库位置,默认查找的位置
dump-file "/var/named/data/cache_dump.db";
pid-file "/run/named/named.pid";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };#允许谁来解析,any是所有
recursion yes;#是否运行递归
zone-statistics yes;
forwarders {192.168.91.2;114.114.114.114;};#设置转发到那台dns(当zone有A记录时,解析本DNS的A记录,当没有时转到指定的DNS去解析)
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
};
logging {#指定日志文件
channel warning {
file "/var/named/log/dns_warning" versions 10 size 10m;
severity warning;
print-category yes;
print-severity yes;
print-time yes;
};
channel general_dns {
file "/var/named/log/dns_log" versions 10 size 10m;
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category default {
warning;
};
category queries {
general_dns;
};
};
include "/etc/rndc.key";
include "/var/named/view.conf";#这里是zone区域配置
[[root@linux-node3 ~]# cat /var/named/view.conf
zone "server.com" IN {
type master;
file "server.com.zone";
allow-transfer { 192.168.10.104; };#允许104过来同步配置文件
};
zone "10.168.192.in-addr.arpa" IN {
type master;
file "10.168.192.arpa";
allow-transfer { 192.168.10.104; };
};
[root@linux-node3 ~]#
[root@linux-node3 ~]# cat /var/named/server.com.zone
$TTL 3600 #定义统一的缓存时长3600秒
@ SOA server.com. admin.server.com. (#必须是第一条
2000 ; serial#解析库的序列号
1D ; refresh#周期性同步的时间间隔
1H ; retry#重试的时间间隔
1W ; expire#过期时长
3H ) ; minimum#否定答案的统一缓存时长
@ IN NS linux-node3.server.com.#@可以省略,默认是上面的@(当前区域的区域名称)
IN NS linux-node4.server.com.
linux-node3 IN A 192.168.10.103
linux-node4 IN A 192.168.10.104
abc IN A 192.168.10.104
[root@linux-node3 ~]# cat /var/named/10.168.192.arpa
$TTL 3600
@ SOA server.com. admin.server.com. (
2000 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS linux-node3.server.com.
IN NS linux-node4.server.com.
103 IN PTR linux-node3.server.com.
104 IN PTR linux-node4.server.com.
104 IN PTR abc.server.com.
给区域配置文件赋予权限和属组:
mkdir -p /var/named/log/
chmod -R 770 /var/named/
chown -R root:named /var/named/
检测配置文件是否有问题:
named-checkconf -z /etc/named.conf #检测主配置文件
named-checkzone /var/named/server.com.zone /var/named/10.168.192.arpa #检测区域配置文件
启动服务:
systemctl restart named && systemctl enable named
三、从DNS的配置:
安装配置跟主的一样,只是view这个配置文件不一样;
[root@linux-node4 ~]# cat /etc/named.conf | grep -v "^$" | grep -v "^#"
options {
listen-on port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
pid-file "/run/named/named.pid";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;
zone-statistics yes;
forwarders {192.168.91.2;114.114.114.114;};
dnssec-enable yes;
dnssec-validation yes;
managed-keys-directory "/var/named/dynamic";
};
logging {
channel warning {
file "/var/named/log/dns_warning" versions 10 size 10m;
severity warning;
print-category yes;
print-severity yes;
print-time yes;
};
channel general_dns {
file "/var/named/log/dns_log" versions 10 size 10m;
severity info;
print-category yes;
print-severity yes;
print-time yes;
};
category default {
warning;
};
category queries {
general_dns;
};
};
include "/etc/rndc.key";
include "/var/named/view.conf";
[root@linux-node4 ~]#
[root@linux-node4 ~]# cat /var/named/view.conf
zone "server.com" IN {#=================修改区域配置文件的zone========
type slave;#修改type为slave
masters { 192.168.10.103; };#masters指主DNS的ip
file "slaves/server.com.zone";#将同步过来的区域配置文件放在/var/named/slaves这个目录下
};
zone "10.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.10.103; };
file "slaves/10.168.192.arpa";
};
给区域配置文件赋予权限和属组:
mkdir -p /var/named/log/
chmod -R 770 /var/named/
chown -R root:named /var/named/
[root@linux-node4 ~]#
[root@linux-node4 ~]# systemctl start named
[root@linux-node4 ~]#
[root@linux-node4 ~]# ll /var/named/slaves/ #两个zone文件同步过来了
total 8
-rw-r--r-- 1 named named 390 Aug 12 09:46 91.168.192.arpa
-rw-r--r-- 1 named named 328 Aug 12 09:46 test.com.zone
验证:
[root@linux-node4 ~]# host abc.server.com
abc.server.com has address 192.168.10.104
[root@linux-node4 ~]# nslookup linux-node3.server.com
Server: 192.168.10.103
Address: 192.168.10.103#53
Name: linux-node3.server.com
Address: 192.168.10.103
[root@linux-node4 ~]# dig @192.168.10.103 linux-node4.server.com
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7 <<>> @192.168.10.103 linux-node4.server.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8707
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;linux-node4.server.com. IN A
;; ANSWER SECTION:
linux-node4.server.com. 3600 IN A 192.168.10.104
;; AUTHORITY SECTION:
server.com. 3600 IN NS linux-node3.server.com.
server.com. 3600 IN NS linux-node4.server.com.
;; ADDITIONAL SECTION:
linux-node3.server.com. 3600 IN A 192.168.10.103
;; Query time: 1 msec
;; SERVER: 192.168.10.103#53(192.168.10.103)
;; WHEN: Wed Aug 15 08:33:37 EDT 2018
;; MSG SIZE rcvd: 123
四、压力测试:
当我们把DNS服务器配置好后,我们肯定会想测试一下DNS服务器的性能如何,上线后如果请求数够多服务器还能否响应?于是,我们可以使用软件模拟环境,对DNS服务器作评估性的测试。在bind中,有一款自带的压力测试软件,queryperf。使用这款软件可以对DNS服务器作请求测试,并且使用方法简单,我们可以使用queryperf测试多次,取一个平均值,这样就算结果不准确,也不会和实际情况相差太大。
queryperf是bind自带的测试软件,所以我们直接上官网下载bind,解压后就能找到queryperf的安装包。解压后,找到目录 contrib ,bind自带的第三方软件全在这个目录里面,我们要用到的queryperf也在里面。
1.下载bind(queryperf)
wget http://ftp.isc.org/isc/bind9/9.9.5/bind-9.9.5.tar.gz
2、安装:
[root@linux-node3 ~]# tar -zxvf bind-9.9.5.tar.gz -C /usr/local/src/
[root@linux-node3 ~]# cd /usr/local/src/bind-9.9.5/contrib/queryperf/
[root@linux-node3 queryperf]# ./configure
[root@linux-node3 queryperf]# make
3、通过上面的编译后,展开queryperf目录,在该目录下已经生成了一个queryperf的可执行文件。这个文件就是我们要用到的程序,我们把该程序移动到/usr/bin/目录下就可以使用了。
[root@zlinux-node3 queryperf]# cp /usr/local/src/bind-9.9.5/contrib/queryperf/queryperf /usr/bin/
4.测试DNS服务器
queryperf使用格式:
queryperf [-d datafile] [-s server_addr] [-p port] [-q num_queries]
-d: 后面接上一个文件,文件的内容是用户对DNS的请求,一行为一条请求,所以为了测试,我们可以在里面写上几千几万条。
-s: DNS服务器地址
-p: DNS服务器端口
-q: 指定查询的输出的最大数量
5、使用vi命令先创建一个请求文件:vi querytest.txt
[root@linux-node3 ~]# vi querytest.txt
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
abc.server.com A
6、执行测试命令:
[root@linux-node3 ~]# queryperf -d querytest.txt -s 192.168.10.103
DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $
[Status] Processing input data
[Status] Sending queries (beginning with 192.168.91.133)
[Status] Testing complete
Statistics:
Parse input file: once
Ended due to: reaching end of file
Queries sent: 56 queries
Queries completed: 56 queries
Queries lost: 0 queries
Queries delayed(?): 0 queries
RTT max: 0.011993 sec
RTT min: 0.001236 sec
RTT average: 0.004352 sec
RTT std deviation: 0.004811 sec
RTT out of range: 0 queries
Percentage completed: 100.00%
Percentage lost: 0.00%
Started at: Mon Aug 13 09:24:41 2018
Finished at: Mon Aug 13 09:24:41 2018
Ran for: 0.014751 seconds
Queries per second: 3796.352790 qps
7、清空再请求测试:
[root@linux-node3 ~]# rndc stats #要先执行这个命令才有下面这个文件,不懂可以打开这个文件看看
[root@linux-node3 ~]# echo >/var/named/data/named_stats.txt
[root@linux-node3 ~]# rndc stats
[root@linux-node3 ~]# queryperf -d querytest.txt -s 192.168.10.103
DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $
[Status] Processing input data
[Status] Sending queries (beginning with 192.168.10.103)
[Status] Testing complete
Statistics:
Parse input file: once
Ended due to: reaching end of file
Queries sent: 56 queries
Queries completed: 56 queries
Queries lost: 0 queries
Queries delayed(?): 0 queries
RTT max: 0.011464 sec
RTT min: 0.000717 sec
RTT average: 0.004654 sec
RTT std deviation: 0.004416 sec
RTT out of range: 0 queries
Percentage completed: 100.00%
Percentage lost: 0.00%
Started at: Mon Aug 13 09:31:10 2018
Finished at: Mon Aug 13 09:31:10 2018
Ran for: 0.015574 seconds
Queries per second: 3595.736484 qps
[root@linux-node3 ~]# queryperf -d querytest.txt -s 192.168.10.103
DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $
[Status] Processing input data
[Status] Sending queries (beginning with 192.168.10.103)
[Status] Testing complete
Statistics:
Parse input file: once
Ended due to: reaching end of file
Queries sent: 56 queries
Queries completed: 56 queries
Queries lost: 0 queries
Queries delayed(?): 0 queries
RTT max: 0.013668 sec
RTT min: 0.001086 sec
RTT average: 0.005314 sec
RTT std deviation: 0.005317 sec
RTT out of range: 0 queries
Percentage completed: 100.00%
Percentage lost: 0.00%
Started at: Mon Aug 13 09:32:57 2018
Finished at: Mon Aug 13 09:32:57 2018
Ran for: 0.018026 seconds
Queries per second: 3106.623766 qps
[root@linux-node3 ~]# cat /var/named/data/named_stats.txt
+++ Statistics Dump +++ (1534167055)
++ Incoming Requests ++
236 QUERY
2 NOTIFY
++ Incoming Queries ++
221 A
2 SOA
1 PTR
2 MX
8 AAAA
2 AXFR
++ Outgoing Queries ++
[View: default]
24 A
6 NS
7 AAAA
[View: _bind]
++ Name Server Statistics ++
238 IPv4 requests received
3 requests with EDNS(0) received
2 TCP requests received
225 responses sent
3 responses with EDNS(0) sent
211 queries resulted in successful answer
190 queries resulted in authoritative answer
32 queries resulted in non authoritative answer
9 queries resulted in nxrrset
1 queries resulted in SERVFAIL
2 queries resulted in NXDOMAIN
32 queries caused recursion
1 duplicate queries received
10 queries dropped
2 requested transfers completed
++ Zone Maintenance Statistics ++
1 IPv4 notifies sent
2 IPv4 notifies received
++ Resolver Statistics ++
[Common]
[View: default]
35 IPv4 queries sent
2 IPv6 queries sent
25 IPv4 responses received
1 SERVFAIL received
12 query retries
10 query timeouts
2 IPv4 NS address fetches
2 IPv6 NS address fetches
2 IPv6 NS address fetch failed
24 queries with RTT 10-100ms
1 queries with RTT 100-500ms
[View: _bind]
++ Cache DB RRsets ++
[View: default]
13 A
3 NS
1 CNAME
2 AAAA
1 DS
1 RRSIG
5 !AAAA
[View: _bind (Cache: _bind)]
++ Socket I/O Statistics ++
38 UDP/IPv4 sockets opened
2 UDP/IPv6 sockets opened
3 TCP/IPv4 sockets opened
1 TCP/IPv6 sockets opened
1 Raw sockets opened
36 UDP/IPv4 sockets closed
2 UDP/IPv6 sockets closed
6 TCP/IPv4 sockets closed
2 UDP/IPv6 socket connect failures
35 UDP/IPv4 connections established
7 TCP/IPv4 connections accepted
2 UDP/IPv6 send errors
++ Per Zone Query Statistics ++
[server.com]
183 queries resulted in successful answer
188 queries resulted in authoritative answer
4 queries resulted in nxrrset
1 queries resulted in NXDOMAIN
1 requested transfers completed
[91.168.192.in-addr.arpa]
1 queries resulted in successful answer
2 queries resulted in authoritative answer
1 queries resulted in NXDOMAIN
1 requested transfers completed
[10.IN-ADDR.ARPA]
[16.172.IN-ADDR.ARPA]
[17.172.IN-ADDR.ARPA]
[18.172.IN-ADDR.ARPA]
[19.172.IN-ADDR.ARPA]
[20.172.IN-ADDR.ARPA]
[21.172.IN-ADDR.ARPA]
[22.172.IN-ADDR.ARPA]
[23.172.IN-ADDR.ARPA]
[24.172.IN-ADDR.ARPA]
[25.172.IN-ADDR.ARPA]
[26.172.IN-ADDR.ARPA]
[27.172.IN-ADDR.ARPA]
[28.172.IN-ADDR.ARPA]
[29.172.IN-ADDR.ARPA]
[30.172.IN-ADDR.ARPA]
[31.172.IN-ADDR.ARPA]
[168.192.IN-ADDR.ARPA]
[64.100.IN-ADDR.ARPA]
[65.100.IN-ADDR.ARPA]
[66.100.IN-ADDR.ARPA]
[67.100.IN-ADDR.ARPA]
[68.100.IN-ADDR.ARPA]
[69.100.IN-ADDR.ARPA]
[70.100.IN-ADDR.ARPA]
[71.100.IN-ADDR.ARPA]
[72.100.IN-ADDR.ARPA]
[73.100.IN-ADDR.ARPA]
[74.100.IN-ADDR.ARPA]
[75.100.IN-ADDR.ARPA]
[76.100.IN-ADDR.ARPA]
[77.100.IN-ADDR.ARPA]
[78.100.IN-ADDR.ARPA]
[79.100.IN-ADDR.ARPA]
[80.100.IN-ADDR.ARPA]
[81.100.IN-ADDR.ARPA]
[82.100.IN-ADDR.ARPA]
[83.100.IN-ADDR.ARPA]
[84.100.IN-ADDR.ARPA]
[85.100.IN-ADDR.ARPA]
[86.100.IN-ADDR.ARPA]
[87.100.IN-ADDR.ARPA]
[88.100.IN-ADDR.ARPA]
[89.100.IN-ADDR.ARPA]
[90.100.IN-ADDR.ARPA]
[91.100.IN-ADDR.ARPA]
[92.100.IN-ADDR.ARPA]
[93.100.IN-ADDR.ARPA]
[94.100.IN-ADDR.ARPA]
[95.100.IN-ADDR.ARPA]
[96.100.IN-ADDR.ARPA]
[97.100.IN-ADDR.ARPA]
[98.100.IN-ADDR.ARPA]
[99.100.IN-ADDR.ARPA]
[100.100.IN-ADDR.ARPA]
[101.100.IN-ADDR.ARPA]
[102.100.IN-ADDR.ARPA]
[103.100.IN-ADDR.ARPA]
[104.100.IN-ADDR.ARPA]
[105.100.IN-ADDR.ARPA]
[106.100.IN-ADDR.ARPA]
[107.100.IN-ADDR.ARPA]
[108.100.IN-ADDR.ARPA]
[109.100.IN-ADDR.ARPA]
[110.100.IN-ADDR.ARPA]
[111.100.IN-ADDR.ARPA]
[112.100.IN-ADDR.ARPA]
[113.100.IN-ADDR.ARPA]
[114.100.IN-ADDR.ARPA]
[115.100.IN-ADDR.ARPA]
[116.100.IN-ADDR.ARPA]
[117.100.IN-ADDR.ARPA]
[118.100.IN-ADDR.ARPA]
[119.100.IN-ADDR.ARPA]
[120.100.IN-ADDR.ARPA]
[121.100.IN-ADDR.ARPA]
[122.100.IN-ADDR.ARPA]
[123.100.IN-ADDR.ARPA]
[124.100.IN-ADDR.ARPA]
[125.100.IN-ADDR.ARPA]
[126.100.IN-ADDR.ARPA]
[127.100.IN-ADDR.ARPA]
[0.IN-ADDR.ARPA]
[127.IN-ADDR.ARPA]
[254.169.IN-ADDR.ARPA]
[2.0.192.IN-ADDR.ARPA]
[100.51.198.IN-ADDR.ARPA]
[113.0.203.IN-ADDR.ARPA]
[255.255.255.255.IN-ADDR.ARPA]
[0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA]
[D.F.IP6.ARPA]
[8.E.F.IP6.ARPA]
[9.E.F.IP6.ARPA]
[A.E.F.IP6.ARPA]
[B.E.F.IP6.ARPA]
[8.B.D.0.1.0.0.2.IP6.ARPA]
[version.bind (view: _bind)]
[hostname.bind (view: _bind)]
[authors.bind (view: _bind)]
[id.server (view: _bind)]
--- Statistics Dump --- (1534167055)
性能测试总结
1、在作服务器的性能测试时,最好不要在服务器平台自身使用测试软件测试,最好换另外一台机器,这样CPU处理的结果会更准确。
2、测试时先预估平台会遇到的最大请求数,用这个请求数作测试,量力而为,因为如果服务器遇到大流量的DDOS,单一机器性能再好,也扛不住。
3、使用queryperf作性能测试时,最好测试多次,取平均值。
4、可以修改配置文件的部分参数测试,如,开启递归,开启查询日志等功能作测试。
安装总结:
DNS建议是编译安装最后,我生产环境上的就是编译安装的。这里是为了我们方便测试速度快一点,所以采用了yum安装的方法。编译安装如下:
https://blog.csdn.net/weixin_41515615/article/details/78884732