#!/usr/bin/python
import time
import sys
import os
i = 1
if len(sys.argv) < 3:
sys.stderr.write('Usage: sys.argv[0] target-domain times-of-test DNS-IP\n')
sys.exit(1)
else:
counter = int(sys.argv[2])
domain = sys.argv[1]
dnsip = sys.argv[3]
while i <= counter:
i += 1
os.system("dig " + domain "@" + dnsip + " | grep NXDOMAIN")
#只要看ouput出來有幾行 NXDOMAIN 就知道大約的錯誤機率了