Skip to content

Instantly share code, notes, and snippets.

@bitkevin
Created September 12, 2014 09:28
Show Gist options
  • Save bitkevin/f22b81978a72ae7cdcff to your computer and use it in GitHub Desktop.
Save bitkevin/f22b81978a72ae7cdcff to your computer and use it in GitHub Desktop.
install_dnsmasq

dnsmasq

apt-get install dnsmasq
  • vim /etc/dnsmasq.conf
resolv-file=/etc/resolv.dnsmasq.conf
# 若监听的地址错误,则修改为:
listen-address=0.0.0.0
  • vim /etc/resolv.dnsmasq.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 114.114.114.114
  • vim /etc/default/dnsmasq
IGNORE_RESOLVCONF=yes
  • 测试之
dig www.tangpool.com @xxx.xxx.xxx.xx

DNS性能测试

  • 安装queryperf
wget "http://www.isc.org/downloads/file/bind-9-9-5-w1/?version=tar.gz" -O  bind-9.9.5-P1.tar.gz
tar zxf bind-9.9.5-P1.tar.gz
cd bind-9.9.5-P1/contrib/queryperf 
./configure
make
cp queryperf /usr/local/bin
  • 准备测试文件 =dnsfile=, 示例内容
www.tangpool.com A
www.baidu.com A
us1.ghash.io A
uk1.ghash.io A
  • 测试命令
queryperf -d dnsfile -s 192.168.1.201

# 测试结果:
DNS Query Performance Testing Tool
Version: $Id: Dnsmasq.txt,v 1.1 2014/08/28 11:30:14 ZhibiaoPan Exp $

[Status] Processing input data
[Status] Sending queries (beginning with 192.168.1.201)
[Status] Testing complete

Statistics:

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

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

  RTT max:         	0.000098 sec
  RTT min:              0.000035 sec
  RTT average:          0.000051 sec
  RTT std deviation:    0.000001 sec
  RTT out of range:     0 queries

  Percentage completed: 100.00%
  Percentage lost:        0.00%

  Started at:           Thu Aug 28 19:32:32 2014
  Finished at:          Thu Aug 28 19:32:32 2014
  Ran for:              0.000159 seconds

  Queries per second:   31446.540881 qps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment