bind包含queryperf的最后版本是9.13.2,也可使用后续独立版本dnsperf
wget https://downloads.isc.org/isc/bind9/9.13.2/bind-9.13.2.tar.gz
tar zxf bind-9.13.2.tar.gz
cd bind-9.13.2/contrib/queryperf
./configure && make
cp queryperf /usr/local/bin/批量生成一些域名:
#!/usr/bin/env python3
def generate_query_file(filename, num_entries, base_domain="qq.com"):
with open(filename, 'w') as f:
for i in range(num_entries):
f.write(f"{base_domain} A\n")
if __name__ == "__main__":
generate_query_file("qq_com.txt", 1000000)
print("测试文件生成完成!")测试:
queryperf -d qq_com.txt -s 192.168.1.1 -p 53 -l 600 标签:none