lost and found ( for me ? )

Showing posts with label queryperf. Show all posts
Showing posts with label queryperf. Show all posts

queryperf DNSSECクエリを投げる方法

-D オプションでできるみたい。


# ./queryperf --help

-D set the DNSSEC OK bit (implies EDNS)

BIND 9.7.0 の queryperf を使用。

-D オプションをつけた結果 

[root@arizona queryperf]# cat querylist.txt
org SOA

[root@arizona queryperf]# ./queryperf -s 127.1 -d querylist.txt -D

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 127.0.0.1)
[Status] Testing complete

Statistics:

  Parse input file:     once
  Ended due to:         reaching end of file

  Queries sent:         1 queries
  Queries completed:    1 queries
  Queries lost:         0 queries
  Queries delayed(?):   0 queries

  RTT max:         0.000095 sec
  RTT min:              0.000095 sec
  RTT average:          0.000095 sec
  RTT std deviation:    0.000045 sec
  RTT out of range:     0 queries

  Percentage completed: 100.00%
  Percentage lost:        0.00%

  Started at:           Wed Mar 10 01:26:09 2010
  Finished at:          Wed Mar 10 01:26:09 2010
  Ran for:              0.000135 seconds

  Queries per second:   7407.407407 qps

[root@arizona queryperf]#

DO flag がついてる。

   Queries
        org: type SOA, class IN
            Name: org
            Type: SOA (Start of zone of authority)
            Class: IN (0x0001)
    Additional records
        : type OPT
            Name:
            Type: OPT (EDNS0 option)
            UDP payload size: 4096
            Higher bits in extended RCODE: 0x0
            EDNS0 version: 0
            Z: 0x8000
                Bit 0 (DO bit): 1 (Accepts DNSSEC security RRs) <- これ
                Bits 1-15: 0x0 (reserved)
            Data length: 0

queryperf っていろいろオプションあるんだなー。

-l で時間の指定、-T でターゲットのqps も指定できるんだー。

-l specifies how a limit for how long to run tests in seconds (no default)
-T specify the target qps (default: 0=unspecified)

ちなみに、-T は大文字じゃなくて、小文字 ( -t ) だとテストがはしったなー。
-T だと、Invalid qps って出て走らないなー。

-T だとだめー。

[root@arizona queryperf]# ./queryperf -s 127.1 -d querylist.txt -D -T 100 -l 10

DNS Query Performance Testing Tool
Version: $Id: queryperf.c,v 1.12 2007/09/05 07:36:04 marka Exp $

Invalid target qps: (null)

-t だとうまくいく。

[root@arizona queryperf]# ./queryperf -s 127.1 -d querylist.txt -D -t 100 -l 10

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 127.0.0.1)
[Status] Testing complete

Statistics:

  Parse input file:     multiple times
  Run time limit:       10 seconds

DNS stress tools: how to install Nominum dnsperf/resperf in Ubuntu 9.10

root@ubuntu:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

- dnsperf/resperf が必要とするパッケージのインストール

# もしかしらたら不要なパッケージもあるかもしれないけど、これでうまくいった

root@ubuntu:~# apt-get install libbind-dev build-essential libssl-dev
root@ubuntu:~# apt-get install dnsutils bind9
root@ubuntu:~# apt-get install libcap-dev tshark

- シンボリックリンクの作成

root@ubuntu:~# cd /usr/lib/
root@ubuntu:/usr/lib# ln -s libgssapi_krb5.so.2.2 libgssapi_krb5.so
root@ubuntu:/usr/lib# ln -s libxml2.so.2.7.5 libxml2.so

- dnsperf/resperf のコンパイル

root@ubuntu:~# pwd
/root

root@ubuntu:~# wget ftp://ftp.nominum.com/pub/nominum/dnsperf/1.0.1.0/dnsperf-src-1.0.1.0-1.tar.gz
root@ubuntu:~# tar xzvf dnsperf-src-1.0.1.0-1.tar.gz
root@ubuntu:~# cd dnsperf-src-1.0.1.0-1
root@ubuntu:~/dnsperf-src-1.0.1.0-1# ./configure
root@ubuntu:~/dnsperf-src-1.0.1.0-1# make

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/man/man1
/usr/bin/install -c dnsperf /usr/local/bin
/usr/bin/install -c resperf /usr/local/bin
/usr/bin/install -c resperf-report /usr/local/bin
/usr/bin/install -c -m 644 dnsperf.1 /usr/local/man/man1
/usr/bin/install -c -m 644 resperf.1 /usr/local/man/man1
root@ubuntu:~/dnsperf-src-1.0.1.0-1#

root@ubuntu:~# which dnsperf
/usr/local/bin/dnsperf
root@ubuntu:~# which resperf
/usr/local/bin/resperf
root@ubuntu:~#

Done!

-----------------

実際に出たエラー、コマンドログも残しとこう。。

root@ubuntu:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"

root@ubuntu:~# apt-get install libbind-dev build-essential libssl-dev
root@ubuntu:~# apt-get install dnsutils bind9
root@ubuntu:~# wget ftp://ftp.nominum.com/pub/nominum/dnsperf/1.0.1.0/dnsperf-src-1.0.1.0-1.tar.gz

root@ubuntu:~# tar xzvf dnsperf-src-1.0.1.0-1.tar.gz
root@ubuntu:~# cd dnsperf-src-1.0.1.0-1
root@ubuntu:~/dnsperf-src-1.0.1.0-1# ./configure

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -

DHAVE_LIBNSL=1 dnsperf.o common.o -lnsl -L/usr/lib -lbind9 -ldns -L/usr/lib -lgssapi_krb5 -lcrypto -lisccfg -lisc -lcap -

lpthread -lxml2 -lm -o dnsperf
/usr/bin/ld: cannot find -lgssapi_krb5
collect2: ld returned 1 exit status
make: *** [dnsperf] エラー 1
root@ubuntu:~/dnsperf-src-1.0.1.0-1#

root@ubuntu:~/dnsperf-src-1.0.1.0-1# find / -name \*gssapi_krb5\*
/usr/lib/libgssapi_krb5.so.2.2
/usr/lib/libgssapi_krb5.so.2
root@ubuntu:~/dnsperf-src-1.0.1.0-1#

root@ubuntu:~/dnsperf-src-1.0.1.0-1# cd /usr/lib/
root@ubuntu:/usr/lib# ln -s libgssapi_krb5.so.2.2 libgssapi_krb5.so

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -

DHAVE_LIBNSL=1 dnsperf.o common.o -lnsl -L/usr/lib -lbind9 -ldns -L/usr/lib -lgssapi_krb5 -lcrypto -lisccfg -lisc -lcap -

lpthread -lxml2 -lm -o dnsperf
/usr/bin/ld: cannot find -lcap
collect2: ld returned 1 exit status
make: *** [dnsperf] エラー 1
root@ubuntu:~/dnsperf-src-1.0.1.0-1#

root@ubuntu:~/dnsperf-src-1.0.1.0-1# apt-get install libcap-dev tshark

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -

DHAVE_LIBNSL=1 dnsperf.o common.o -lnsl -L/usr/lib -lbind9 -ldns -L/usr/lib -lgssapi_krb5 -lcrypto -lisccfg -lisc -lcap -

lpthread -lxml2 -lm -o dnsperf
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [dnsperf] エラー 1

root@ubuntu:~/dnsperf-src-1.0.1.0-1# apt-get install apt-file
root@ubuntu:~/dnsperf-src-1.0.1.0-1# apt-file update

root@ubuntu:/usr/lib# ln -s libxml2.so.2.7.5 libxml2.so

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -

DHAVE_LIBNSL=1 dnsperf.o common.o -lnsl -L/usr/lib -lbind9 -ldns -L/usr/lib -lgssapi_krb5 -lcrypto -lisccfg -lisc -lcap -

lpthread -lxml2 -lm -o dnsperf
gcc -I/usr/include -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -

DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -c resperf.c
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -

DHAVE_LIBNSL=1 resperf.o common.o -lnsl -L/usr/lib -lbind9 -ldns -L/usr/lib -lgssapi_krb5 -lcrypto -lisccfg -lisc -lcap -

lpthread -lxml2 -lm -o resperf

root@ubuntu:~/dnsperf-src-1.0.1.0-1# make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/man/man1
/usr/bin/install -c dnsperf /usr/local/bin
/usr/bin/install -c resperf /usr/local/bin
/usr/bin/install -c resperf-report /usr/local/bin
/usr/bin/install -c -m 644 dnsperf.1 /usr/local/man/man1
/usr/bin/install -c -m 644 resperf.1 /usr/local/man/man1
root@ubuntu:~/dnsperf-src-1.0.1.0-1#