Exemplo n.º 1
0
 def dig_ip_worker(self):
     try:
         for ip in self.dig_ips:
             if ip in self.dig_ipdict or ip in self.dig_finishedip:
                 continue
             self.dig_ipdict.append(ip)
             if not check_ip_valid(ip):
                 print('ip: %s is invalid, reset to default ip: %s' % (ip, default_ip))
                 ip = default_ip
             print('\ndig ip: %s' % ip)
             cmd = ['1', '+subnet=%s/32' % ip, '@ns1.google.com', 'www.google.com']
             code = pydig(cmd)
             self.dig_lock.acquire()
             if code == 502:
                 open(dig_error, "a").write(ip + "\n")
             else:
                 open(dig_finished, "a").write(ip + "\n")
             self.dig_lock.release()
     except:
         pass
     finally:
         self.dig_lock.acquire()
         print 'dig_ip_worker exit'
         self.dig_thread_num -= 1
         self.dig_lock.release()
Exemplo n.º 2
0
 def dig_ip_worker(self):
     try:
         for ip in self.dig_ips:
             if ip in self.dig_ipdict or ip in self.dig_finishedip:
                 continue
             self.dig_ipdict.append(ip)
             if not check_ip_valid(ip):
                 print('ip: %s is invalid, reset to default ip: %s' % (ip, default_ip))
                 ip = default_ip
             print('\ndig ip: %s' % ip)
             cmd = ['1', '+subnet=%s/32' % ip, '@ns1.google.com', 'www.google.com']
             code = pydig(cmd)
             self.dig_lock.acquire()
             if code == 502:
                 open(dig_error, "a").write(ip + "\n")
             else:
                 open(dig_finished, "a").write(ip + "\n")
             self.dig_lock.release()
     except:
         pass
     finally:
         self.dig_lock.acquire()
         print 'dig_ip_worker exit'
         self.dig_thread_num -= 1
         self.dig_lock.release()
Exemplo n.º 3
0
def dig_ip(ip):
    if not check_ip_valid(ip):
        print('ip: %s is invalid, reset to default ip: %s' % (ip, default_ip))
        ip = default_ip
    print('\ndig ip: %s' % ip)
    cmd = ['1', '+subnet=%s/32' % ip, '@ns1.google.com', 'www.google.com']
    code = pydig(cmd)
    if code == 502:
        open(dig_error, "a").write(ip + "\n")
    else:
        open(dig_finished, "a").write(ip + "\n")
Exemplo n.º 4
0
def dig_ip(ip):
    if not check_ip_valid(ip):
        print('ip: %s is invalid, reset to default ip: %s' % (ip, default_ip))
        ip = default_ip
    print('\ndig ip: %s' % ip)
    cmd = ['1', '+subnet=%s/32' % ip, '@ns1.google.com', 'www.google.com']
    code = pydig(cmd)
    if code == 502:
        open(dig_error, "a").write(ip + "\n")
    else:
        open(dig_finished, "a").write(ip + "\n")