lost and found ( for me ? )

CentOS 6.3 64 bit : install dnsperf from source code

dnsperf is a DNS stressing tool provided by Nominum.
dnsperf is similar to queryperf in which included BIND source packages.

As for CentOS4,5,6 32bit ver , there are RPM packages , however there are no RPM packages for 64bit OSes.
http://www.nominum.com/support/measurement-tools/

So I’ll build dnsperf from source code.

# uname –ri
2.6.32-279.11.1.el6.x86_64 x86_64

# cat /etc/centos-release
CentOS release 6.3 (Final)


[ logs when building dnsperf including trial and error ]

download dnsperf-src-2.0.0.0-1.tar.gz from http://www.nominum.com/support/measurement-tools/
# tar xzvf dnsperf-src-2.0.0.0-1.tar.gz
# cd dnsperf-src-2.0.0.0-1


To build dnssperf , BIND 9.4 or greater has been installed , including library and header files. ( please check README file )

install bind , bind library , bind header files , gcc and make with yum
# yum install -ybind bind-devel bind-libs
# yum install make gcc –y


build dnsperf
# sh configure


error.. dns.c:46:25: error: isc/hmacsha.h: No such file or directory
# make
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c dnsperf.c
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c datafile.c
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c dns.c
dns.c:46:25: error: isc/hmacsha.h: No such file or directory
dns.c:96: error: expected specifier-qualifier-list before 'isc_hmacsha1_t'
dns.c: In function 'perf_dns_parsetsigkey':
dns.c:246: error: 'ISC_SHA1_DIGESTLENGTH' undeclared (first use in this function)
dns.c:246: error: (Each undeclared identifier is reported only once
dns.c:246: error: for each function it appears in.)
dns.c:248: error: 'ISC_SHA224_DIGESTLENGTH' undeclared (first use in this function)
dns.c:250: error: 'ISC_SHA256_DIGESTLENGTH' undeclared (first use in this function)
dns.c:252: error: 'ISC_SHA384_DIGESTLENGTH' undeclared (first use in this function)
dns.c:254: error: 'ISC_SHA512_DIGESTLENGTH' undeclared (first use in this function)
dns.c: In function 'hmac_init':
dns.c:344: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:347: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:350: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:353: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:356: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'hmac_update':
dns.c:370: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:373: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:376: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:379: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:382: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'hmac_sign':
dns.c:396: error: 'hmac_ctx_t' has no member named 'hmacsha1'
dns.c:399: error: 'hmac_ctx_t' has no member named 'hmacsha224'
dns.c:402: error: 'hmac_ctx_t' has no member named 'hmacsha256'
dns.c:405: error: 'hmac_ctx_t' has no member named 'hmacsha384'
dns.c:408: error: 'hmac_ctx_t' has no member named 'hmacsha512'
dns.c: In function 'add_tsig':
dns.c:427: error: 'ISC_SHA256_DIGESTLENGTH' undeclared (first use in this function)
make: *** [dns.o] Error 1


Seen from README , it describes:
  Note: many versions of bind do not correctly install the <isc/hmacsha.h>
  header file, so if the compilation fails, obtain this file from the BIND
  source distribution, and install it in the appropriate place.


where is “hmacsha.h” header file ?
# rpm -ql `rpm -qa | grep bind-devel` | grep hmac
/usr/include/isc/hmacmd5.h
#


nn , hmacsha.h has not been installed..

download bind-9.9.2.tar.gz from www.isc.org and copy hmacsha.h file to /usr/include/isc directory.
# bind-9.9.2.tar.gz
# tar xzvf bind-9.9.2.tar.gz
# cp bind-9.9.2/lib/isc/include/isc/hmacsha.h /usr/include/isc/


try again
# sh configure


error .
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lgssapi_krb5
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1


where is “lgssapi_krb5” ?
# locate gssapi_krb5
/lib64/libgssapi_krb5.so.2
/lib64/libgssapi_krb5.so.2.2


make a symbolic link.
# ln -s /lib64/libgssapi_krb5.so.2.2 /usr/lib64/libgssapi_krb5.so

# ls -l /usr/lib64/libgssapi_krb5.so
lrwxrwxrwx 1 root root 28 Oct 31 21:59 /usr/lib64/libgssapi_krb5.so -> /lib64/libgssapi_krb5.so.2.2


error
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# ln -s /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so


error
# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lcap
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# yum install libcap-devel

# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

# yum install libxml2-devel -y

# sh configure

# make
gcc -pthread dnsperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o dnsperf
gcc -g -O2 -I/usr/include -D_REENTRANT -DDIG_SIGCHASE -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DHAVE_PTHREAD=1 -pthread -c resperf.c
gcc -pthread resperf.o  libperf.a -lnsl  -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -lxml2 -lz -lm  -lm -o resperf

# make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/share/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/share/man/man1
/usr/bin/install -c -m 644  resperf.1 /usr/local/share/man/man1


Okay , get things done :D

3 comments:

  1. You are wonderful , Many Thanks for the details !!

    ReplyDelete
  2. Hi Rishi
    thank you for stopping by my blog
    it's my pleasure :D

    ReplyDelete
  3. More blessings to you and more knowledge. People always stop by but only few give gratitude.

    ReplyDelete

Note: Only a member of this blog may post a comment.