Wednesday, March 6, 2019

.::: Install & Using dnsperf on Centos7 & Ubuntu with example DNS testing :::.

DNSPerf and ResPerf are free tools developed by Nominum that make it simple to gather accurate latency and throughput metrics for Domain Name Service (DNS). These tools are easy-to-use and simulate typical Internet so network operators can benchmark their naming and addressing infrastructure and plan for upgrades. The latest version of the DNSPerf and ResPerf can be used with test files that include IPv6 queries.

1. Install requirement package dnsperf

[root@bind-server-teguhtriharto data]# wget http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/pcapy-0.10.8-5.el7.x86_64.rpm

[root@bind-server-teguhtriharto data]# yum -y install gnuplot* pcapy* python-dns*

2. Install dnsperf
[root@bind-server-teguhtriharto data]# wget https://centos.pkgs.org/7/nux-dextop-x86_64/dnsperf-2.1.0.0-2.el7.nux.x86_64.rpm.html
[root@bind-server-teguhtriharto data]# http://li.nux.ro/download/nux/dextop/el7/x86_64//dnsperf-2.1.0.0-2.el7.nux.x86_64.rpm
[root@bind-server-teguhtriharto data]# rpm -ivh dnsperf*
https://youtu.be/H62bVeqGNEA https://youtu.be/3I32Q0VLr2Y
3. Constructing a query input file
A,NS,MD,MF,CNAME,SOA,MB,MG,MR,NULL,WKS,PTR,HINFO,MINFO, MX,TXT,AAAA,SRV,NAPTR,A6,ASFR,MAILB,MAILA,ANY.

example
[root@bind-server-teguhtriharto data]# cat n.txt
google.com A
teguhtriharto.com A
[root@bind-server-teguhtriharto data]#

or you can download

# wget https://www.dns-oarc.net/files/dnsperf/data/queryfile-example-10million-201202.gz
# gunzip queryfile-example-10million-201202.gz
# wget ftp://ftp.nominum.com/pub/nominum/dnsperf/data/queryfile-example-current.gz
# gunzip queryfile-example-current.gz

4. Test running
# dnsperf -s 10.10.10.10 -d queryfile-example-10million-201202 -l 6 -c 1 -Q 10
# dnsperf -s 10.10.10.10 -d queryfile-example-current -l 6 -c 1 -Q 1
# dnsperf -s 10.10.10.10 -d n.txt -l 6 -c 1 -Q 10
# dnsperf -s 10.10.10.10 -d n.txt -l 4 -c 3 -Q 2

example run

[root@bind-server-teguhtriharto data]# dnsperf -h
DNS Performance Testing Tool
Nominum Version 2.1.0.0

Usage: dnsperf [-f family] [-s server_addr] [-p port] [-a local_addr]
               [-x local_port] [-d datafile] [-c clients] [-T threads]
               [-n maxruns] [-l timelimit] [-b buffer_size] [-t timeout]
               [-e] [-D] [-y [alg:]name:secret] [-q num_queries]
               [-Q max_qps] [-S stats_interval] [-u] [-v] [-h]
  -f address family of DNS transport, inet or inet6 (default: any)
  -s the server to query (default: 127.0.0.1)
  -p the port on which to query the server (default: 53)
  -a the local address from which to send queries
  -x the local port from which to send queries (default: 0)
  -d the input data file (default: stdin)
  -c the number of clients to act as
  -T the number of threads to run
  -n run through input at most N times
  -l run for at most this many seconds 
  -b socket send/receive buffer size in kilobytes
  -t the timeout for query completion in seconds (default: 5)
  -e enable EDNS 0
  -D set the DNSSEC OK bit (implies EDNS)
  -y the TSIG algorithm, name and secret
  -q the maximum number of queries outstanding (default: 100)
  -Q limit the number of queries per second
  -S print qps statistics every N seconds
  -u send dynamic updates instead of queries
  -v verbose: report each query to stdout
  -h print this help
[root@bind-server-teguhtriharto data]#

[root@bind-server-teguhtriharto data]# dnsperf -s 10.10.10.10 -d n.txt -l 6 -c 1 -Q 10
DNS Performance Testing Tool
Nominum Version 2.1.0.0

[Status] Command line: dnsperf -s 10.10.10.10 -d n.txt -l 6 -c 1 -Q 10
[Status] Sending queries (to 10.10.10.10)
[Status] Started at: Wed Mar  6 14:13:12 2019
[Status] Stopping after 6.000000 seconds
[Status] Testing complete (time limit)

Statistics:

  Queries sent:         60
  Queries completed:    60 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 60 (100.00%)
  Average packet size:  request 28, response 124
  Run time (s):         6.000744
  Queries per second:   9.998760

  Average Latency (s):  0.001406 (min 0.000954, max 0.002996)
  Latency StdDev (s):   0.000323

[root@bind-server-teguhtriharto data]#

[root@bind-server-teguhtriharto data]# dnsperf -s 10.10.10.10 -d n.txt -l 4 -c 1 -Q 2
DNS Performance Testing Tool
Nominum Version 2.1.0.0

[Status] Command line: dnsperf -s 10.10.10.10 -d n.txt -l 4 -c 1 -Q 2
[Status] Sending queries (to 10.10.10.10)
[Status] Started at: Wed Mar  6 14:41:42 2019
[Status] Stopping after 4.000000 seconds
[Status] Testing complete (time limit)

Statistics:

  Queries sent:         8
  Queries completed:    8 (100.00%)
  Queries lost:         0 (0.00%)

  Response codes:       NOERROR 4 (50.00%), NXDOMAIN 4 (50.00%)
  Average packet size:  request 31, response 76
  Run time (s):         4.000746
  Queries per second:   1.999627

  Average Latency (s):  0.022457 (min 0.000842, max 0.097227)
  Latency StdDev (s):   0.032957

[root@bind-server-teguhtriharto data]#


B. if you using ubuntu

#!/bin/bash

# Installing related packages
sudo apt-get install -y bind9utils libbind-dev libkrb5-dev libssl-dev libcap-dev libxml2-dev
sudo apt-get install -y geoip-bin libgeoip-dev build-essential curl wget
# Download query sample file

wget https://www.dns-oarc.net/files/dnsperf/data/queryfile-example-10million-201202.gz

wget ftp://ftp.nominum.com/pub/nominum/dnsperf/data/queryfile-example-current.gz

# Download dnsperf source file
curl ftp://ftp.nominum.com/pub/nominum/dnsperf/2.1.0.0/dnsperf-src-2.1.0.0-1.tar.gz -O
# Extracting files
tar xfvz dnsperf-src-2.1.0.0-1.tar.gz
cd dnsperf-src-2.1.0.0-1
# configure
./configure
make clean
make
# install

sudo make install

1 comment:

Popular Posts