how to build dnsperf

dnsperf是nominum提供的免費dns性能測試工具,ubuntu下面沒有現成的包,需要自己下載自己編譯

代碼地址:

 ftp://ftp.nominum.com/pub/nominum/dnsperf/2.0.0.0/dnsperf-src-2.0.0.0-1.tar.gz

編譯的時候也不會那麼順利,有些庫的依賴需要解決。簡單記錄問題和解決辦法如下:

  1. download source code via ftp
  2. configure, normally, you would encounter an error like below
configure: error: BIND 9 libraries must be installed
solution: apt-get install libbind-dev

3. make,  below error is always being met.
dns.c:46: fatal error: isc/hmacsha.h: No such file or directory
The solution is to download bind9 source code and extract isc/hmacsha.h and put it under /usr/include/isc/

4. make it again

gcc -pthread dnsperf.o libperf.a -lnsl -L/usr/lib -lbind9 -ldns -lgssapi_krb5 -lcrypto -lisccfg -lisc -ldl -lcap -lpthread -L/usr/lib/x86_64-linux-gnu -lxml2 -lm -o dnsperf
/usr/bin/ld: cannot find -lgssapi_krb5
/usr/bin/ld: cannot find -lcap

it does not make effect that add "-L" before -lgssapi

The solution is to install libcap2-dev and libkrb5-dev

gcc -pthread dnsperf.o libperf.a -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 -lcrypto
collect2: ld returned 1 exit status
make: *** [dnsperf] Error 1

installing libcrypto++ or libcrypto++-dev doest not work. Need to install libssl-dev

gcc -pthread dnsperf.o libperf.a -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] Error 1

solution:apt-get install libxml2-dev


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章